-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor ovn playbook to ansible role files
Signed-off-by: Markus Katharina Brechtel <[email protected]>
- Loading branch information
1 parent
2358973
commit 405903c
Showing
4 changed files
with
95 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ovn_name: '' | ||
ovn_roles: [] | ||
ovn_release: distro | ||
ovn_ip_address: "{{ ansible_default_ipv6['address'] | default(ansible_default_ipv4['address']) }}" | ||
ovn_az_name: "{{ ovn_az_name | default('') }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
- name: Configure OVS | ||
shell: ovs-vsctl set open_vswitch . external_ids:ovn-remote={{ ovn_central_southbound }} external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip={{ ovn_ip_address }} | ||
|
||
- name: Enable OVN IC gateway | ||
shell: | ||
cmd: "ovs-vsctl set open_vswitch . external_ids:ovn-is-interconn=true" | ||
when: '"ic-gateway" in ovn_roles' | ||
|
||
- name: Configure OVN central northbound DB for SSL (certs) | ||
shell: | ||
cmd: "ovn-nbctl set-ssl /etc/ovn/{{ ovn_name }}.server.key /etc/ovn/{{ ovn_name }}.server.crt /etc/ovn/{{ ovn_name }}.ca.crt" | ||
when: '"central" in ovn_roles' | ||
|
||
- name: Configure OVN central northbound DB for SSL (ports) | ||
shell: | ||
cmd: "ovn-nbctl set-connection pssl:6641:[::]" | ||
when: '"central" in ovn_roles' | ||
|
||
- name: Configure OVN central southbound DB for SSL (certs) | ||
shell: | ||
cmd: "ovn-sbctl set-ssl /etc/ovn/{{ ovn_name }}.server.key /etc/ovn/{{ ovn_name }}.server.crt /etc/ovn/{{ ovn_name }}.ca.crt" | ||
when: '"central" in ovn_roles' | ||
|
||
- name: Configure OVN central southbound DB for SSL (ports) | ||
shell: | ||
cmd: "ovn-sbctl set-connection pssl:6642:[::]" | ||
when: '"central" in ovn_roles' | ||
|
||
- name: Configure OVN IC northbound DB for SSL (certs) | ||
shell: | ||
cmd: "ovn-ic-nbctl set-ssl /etc/ovn/{{ ovn_name }}.server.key /etc/ovn/{{ ovn_name }}.server.crt /etc/ovn/{{ ovn_name }}.ca.crt" | ||
when: '"ic-db" in ovn_roles' | ||
|
||
- name: Configure OVN IC northbound DB for SSL (ports) | ||
shell: | ||
cmd: "ovn-ic-nbctl set-connection pssl:6645:[::]" | ||
when: '"ic-db" in ovn_roles' | ||
|
||
- name: Configure OVN IC southbound DB for SSL (certs) | ||
shell: | ||
cmd: "ovn-ic-sbctl set-ssl /etc/ovn/{{ ovn_name }}.server.key /etc/ovn/{{ ovn_name }}.server.crt /etc/ovn/{{ ovn_name }}.ca.crt" | ||
when: '"ic-db" in ovn_roles' | ||
|
||
- name: Configure OVN IC southbound DB for SSL (ports) | ||
shell: | ||
cmd: "ovn-ic-sbctl set-connection pssl:6646:[::]" | ||
when: '"ic-db" in ovn_roles' | ||
|
||
- name: Restart OVN central | ||
systemd: | ||
name: ovn-central.service | ||
state: restarted | ||
|
||
- name: Restart OVN host | ||
systemd: | ||
name: ovn-host.service | ||
state: restarted | ||
|
||
- name: Restart OVN IC | ||
systemd: | ||
daemon_reload: true | ||
name: ovn-ic.service | ||
state: restarted | ||
when: '"ic" in ovn_roles' | ||
|
||
- name: Restart OVN IC databases | ||
systemd: | ||
name: ovn-ic-db.service | ||
state: restarted | ||
when: '"ic-db" in ovn_roles' | ||
|
||
- name: Configure OVN AZ name | ||
shell: | ||
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 }}" | ||
when: '"central" in ovn_roles and ovn_az_name' | ||
|
||
- name: Enable OVN IC route sharing | ||
shell: | ||
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" | ||
when: '"central" in ovn_roles and ovn_az_name' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ovn_pki_path: "../data/ovn/{{ ovn_name }}/" | ||
|
||
ovn_central_northbound: "{{ lookup('template', '../files/ovn/ovn-central.servers.tpl') | from_yaml | map('regex_replace', '^(.*)$', 'ssl:[\\1]:6641') | join(',') }}" | ||
ovn_central_southbound: "{{ lookup('template', '../files/ovn/ovn-central.servers.tpl') | from_yaml | map('regex_replace', '^(.*)$', 'ssl:[\\1]:6642') | join(',') }}" | ||
ovn_ic_northbound: "{{ lookup('template', '../files/ovn/ovn-ic.servers.tpl') | from_yaml | map('regex_replace', '^(.*)$', 'ssl:[\\1]:6645') | join(',') }}" | ||
ovn_ic_southbound: "{{ lookup('template', '../files/ovn/ovn-ic.servers.tpl') | from_yaml | map('regex_replace', '^(.*)$', 'ssl:[\\1]:6646') | join(',') }}" |