kolla-ansible/ansible/roles/ovn/tasks/bootstrap.yml
Michał Nasiadka aff99355d2 ovn: make DVR work on VLAN tenant networks
In order for DVR to work on VLAN tenant networks we need to configure
external_ids:ovn-chassis-mac-mappings with per node generated MAC [1]
on computes [1].

[1]: 1fed74cfc1

Co-Authored-By: Bartosz Bezak <bartosz@stackhpc.com>

Depends-On: https://review.opendev.org/c/openstack/neutron/+/782250
Change-Id: I3a3ccde5b9ef2afb4c3e9206f13827687880cb57
2021-05-06 10:17:59 +00:00

36 lines
1.8 KiB
YAML

---
- name: Create br-int bridge on OpenvSwitch
become: true
kolla_toolbox:
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 '' }}"
become: true
kolla_toolbox:
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-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' }}" }