<commit_before>---
- hosts: controller[0]
  tasks:
  - name: determine Neutron external interface name
    action: neutron_network
      name=external
      login_tenant_name=admin
      login_password={{ <PASSWORD> }}
      {% if client.self_signed_cert -%}
        cacert=/opt/stack/ssl/openstack.crt
      {% endif -%}
    register: result
    ignore_errors: true
    notify: ifdown bridge

  - set_fact: neutron_external_interface=brq{{ result.id|truncate(length=11,killwords=true,end='') }}
  - shell: sed -i.bak s/br-ex/{{ neutron_external_interface }}/g /etc/network/interfaces
    when: neutron.plugin == 'ml2'  and not result.rc == 0
    notify: ifup bridge

  handlers:
  - name: ifdown bridge
    command: ifdown br-ex
  - name: ifup bridge
    command: ifup {{neutron_external_interface}}<commit_msg>updated based on @j2sol suggestions<commit_after>---
- hosts: controller[0]
  tasks:
  - name: determine Neutron external interface name
    action: neutron_network
      name=external
      login_tenant_name=admin
      login_password={{ <PASSWORD> }}
      {% if client.self_signed_cert -%}
        cacert=/opt/stack/ssl/openstack.crt
      {% endif -%}
    register: result
    failed_when: False
    notify: ifdown bridge

  - set_fact: neutron_external_interface=brq{{ result.id|truncate(length=11,killwords=true,end='') }}
  - shell: sed -i.bak s/br-ex/{{ neutron_external_interface }}/g /etc/network/interfaces
    when: neutron.plugin == 'ml2'  and result|failed
    notify: ifup bridge

  handlers:
  - name: ifdown bridge
    command: ifdown br-ex
  - name: ifup bridge
    command: ifup {{neutron_external_interface}}
{'fraction_non_alphanumeric': 0.11890243902439024, 'fraction_numerical': 0.006097560975609756, 'mean_word_length': 3.3070866141732282, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '797268', 'n_tokens_mistral': 554, 'n_tokens_neox': 530, 'n_words': 121}