6768b760ab
With the new ``neutron_ovn_availability_zones`` parameter it is possible to define network availability zones for OVN. Further details can be found in the Neutron OVN documentation: https://docs.openstack.org/neutron/latest/admin/ovn/availability_zones.html#how-to-configure-it Change-Id: I203e0d400a3218d0b4a41f2a948207032c4febec
41 lines
2.3 KiB
YAML
41 lines
2.3 KiB
YAML
---
|
|
- name: Create br-int bridge on OpenvSwitch
|
|
become: true
|
|
kolla_toolbox:
|
|
container_engine: "{{ kolla_container_engine }}"
|
|
user: root
|
|
module_name: openvswitch_bridge
|
|
module_args:
|
|
bridge: br-int
|
|
state: present
|
|
fail_mode: secure
|
|
|
|
- name: Configure OVN in OVSDB
|
|
vars:
|
|
ovn_mappings: "{% for bridge in neutron_bridge_name.split(',') %}physnet{{ loop.index0 + 1 }}:{{ bridge }}{% if not loop.last %},{% endif %}{% endfor %}"
|
|
ovn_macs: "{% for bridge in neutron_bridge_name.split(',') %}physnet{{ loop.index0 + 1 }}:{{ ovn_base_mac | random_mac(seed=inventory_hostname + bridge) }}{% if not loop.last %},{% endif %}{% endfor %}"
|
|
ovn_cms_opts: "{{ 'enable-chassis-as-gw' if inventory_hostname in groups['ovn-controller-network'] else '' }}{{ ',availability-zones=' + neutron_ovn_availability_zones | join(',') if inventory_hostname in groups['ovn-controller-network'] and neutron_ovn_availability_zones }}"
|
|
become: true
|
|
kolla_toolbox:
|
|
container_engine: "{{ kolla_container_engine }}"
|
|
user: root
|
|
module_name: openvswitch_db
|
|
module_args:
|
|
table: Open_vSwitch
|
|
record: .
|
|
col: external_ids
|
|
key: "{{ item.name }}"
|
|
value: "{{ item.value if item.state | default('present') == 'present' else omit }}"
|
|
state: "{{ item.state | default('present') }}"
|
|
loop:
|
|
- { name: ovn-encap-ip, value: "{{ tunnel_interface_address }}" }
|
|
- { name: ovn-encap-type, value: geneve }
|
|
- { name: ovn-remote, value: "{{ ovn_sb_connection }}" }
|
|
- { name: ovn-remote-probe-interval, value: "{{ ovn_remote_probe_interval }}" }
|
|
- { name: ovn-openflow-probe-interval, value: "{{ ovn_openflow_probe_interval }}" }
|
|
- { name: ovn-monitor-all, value: "{{ ovn_monitor_all | bool }}" }
|
|
- { name: ovn-bridge-mappings, value: "{{ ovn_mappings }}", state: "{{ 'present' if (inventory_hostname in groups['ovn-controller-network'] or computes_need_external_bridge | bool) else 'absent' }}" }
|
|
- { name: ovn-chassis-mac-mappings, value: "{{ ovn_macs }}", state: "{{ 'present' if inventory_hostname in groups['ovn-controller-compute'] else 'absent' }}" }
|
|
- { name: ovn-cms-options, value: "{{ ovn_cms_opts }}", state: "{{ 'present' if ovn_cms_opts != '' else 'absent' }}" }
|
|
when: inventory_hostname in groups.get('ovn-controller', [])
|