|
| 1 | +--- |
| 2 | +- name: Update apt |
| 3 | + apt: |
| 4 | + force_apt_get: yes |
| 5 | + update_cache: yes |
| 6 | + cache_valid_time: 0 |
| 7 | + |
| 8 | +- name: Configure OVS |
| 9 | + shell: ovs-vsctl set open_vswitch . external_ids:hostname={{ inventory_hostname }} external_ids:ovn-remote={{ ovn_central_southbound }} external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip={{ ovn_ip_address }} |
| 10 | + |
| 11 | +- name: Enable OVN IC gateway |
| 12 | + shell: |
| 13 | + cmd: "ovs-vsctl set open_vswitch . external_ids:ovn-is-interconn=true" |
| 14 | + when: '"ic-gateway" in ovn_roles' |
| 15 | + |
| 16 | +- name: Configure OVN central northbound DB for SSL (certs) |
| 17 | + shell: |
| 18 | + cmd: "ovn-nbctl set-ssl /etc/ovn/{{ ovn_name }}.server.key /etc/ovn/{{ ovn_name }}.server.crt /etc/ovn/{{ ovn_name }}.ca.crt" |
| 19 | + when: '"central" in ovn_roles' |
| 20 | + |
| 21 | +- name: Configure OVN central northbound DB for SSL (ports) |
| 22 | + shell: |
| 23 | + cmd: "ovn-nbctl set-connection pssl:6641:[::]" |
| 24 | + when: '"central" in ovn_roles' |
| 25 | + |
| 26 | +- name: Configure OVN central southbound DB for SSL (certs) |
| 27 | + shell: |
| 28 | + cmd: "ovn-sbctl set-ssl /etc/ovn/{{ ovn_name }}.server.key /etc/ovn/{{ ovn_name }}.server.crt /etc/ovn/{{ ovn_name }}.ca.crt" |
| 29 | + when: '"central" in ovn_roles' |
| 30 | + |
| 31 | +- name: Configure OVN central southbound DB for SSL (ports) |
| 32 | + shell: |
| 33 | + cmd: "ovn-sbctl set-connection pssl:6642:[::]" |
| 34 | + when: '"central" in ovn_roles' |
| 35 | + |
| 36 | +- name: Configure OVN IC northbound DB for SSL (certs) |
| 37 | + shell: |
| 38 | + cmd: "ovn-ic-nbctl set-ssl /etc/ovn/{{ ovn_name }}.server.key /etc/ovn/{{ ovn_name }}.server.crt /etc/ovn/{{ ovn_name }}.ca.crt" |
| 39 | + when: '"ic-db" in ovn_roles' |
| 40 | + |
| 41 | +- name: Configure OVN IC northbound DB for SSL (ports) |
| 42 | + shell: |
| 43 | + cmd: "ovn-ic-nbctl set-connection pssl:6645:[::]" |
| 44 | + when: '"ic-db" in ovn_roles' |
| 45 | + |
| 46 | +- name: Configure OVN IC southbound DB for SSL (certs) |
| 47 | + shell: |
| 48 | + cmd: "ovn-ic-sbctl set-ssl /etc/ovn/{{ ovn_name }}.server.key /etc/ovn/{{ ovn_name }}.server.crt /etc/ovn/{{ ovn_name }}.ca.crt" |
| 49 | + when: '"ic-db" in ovn_roles' |
| 50 | + |
| 51 | +- name: Configure OVN IC southbound DB for SSL (ports) |
| 52 | + shell: |
| 53 | + cmd: "ovn-ic-sbctl set-connection pssl:6646:[::]" |
| 54 | + when: '"ic-db" in ovn_roles' |
| 55 | + |
| 56 | +- name: Restart OVN central |
| 57 | + systemd: |
| 58 | + name: ovn-central.service |
| 59 | + state: restarted |
| 60 | + |
| 61 | +- name: Restart OVN host |
| 62 | + systemd: |
| 63 | + name: ovn-host.service |
| 64 | + state: restarted |
| 65 | + |
| 66 | +- name: Restart OVN IC |
| 67 | + systemd: |
| 68 | + daemon_reload: true |
| 69 | + name: ovn-ic.service |
| 70 | + state: restarted |
| 71 | + when: '"ic" in ovn_roles' |
| 72 | + |
| 73 | +- name: Restart OVN IC databases |
| 74 | + systemd: |
| 75 | + name: ovn-ic-db.service |
| 76 | + state: restarted |
| 77 | + when: '"ic-db" in ovn_roles' |
| 78 | + |
| 79 | +- name: Configure OVN AZ name |
| 80 | + shell: |
| 81 | + cmd: "ovn-nbctl --db={{ ovn_central_northbound }} -c /etc/ovn/{{ ovn_name }}.server.crt -p /etc/ovn/{{ ovn_name }}.server.key -C /etc/ovn/{{ ovn_name }}.ca.crt set NB_Global . name={{ ovn_az_name }}" |
| 82 | + when: '"central" in ovn_roles and ovn_az_name' |
| 83 | + |
| 84 | +- name: Enable OVN IC route sharing |
| 85 | + shell: |
| 86 | + cmd: "ovn-nbctl --db={{ ovn_central_northbound }} -c /etc/ovn/{{ ovn_name }}.server.crt -p /etc/ovn/{{ ovn_name }}.server.key -C /etc/ovn/{{ ovn_name }}.ca.crt set NB_Global . options:ic-route-adv=true options:ic-route-learn=true" |
| 87 | + when: '"central" in ovn_roles and ovn_az_name' |
0 commit comments