-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix roles that used end_play in playbooks by spliting out the section…
…s into separate task files with conditions Signed-off-by: Markus Katharina Brechtel <markus.katharina.brechtel@thengo.net>
- Loading branch information
1 parent
6876d7a
commit e83e998
Showing
9 changed files
with
302 additions
and
318 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,33 @@ | ||
--- | ||
|
||
- name: Create keyring path | ||
file: | ||
path: /etc/apt/keyrings/ | ||
mode: 0755 | ||
state: directory | ||
when: 'ceph_roles|length > 0 and ceph_release != "distro"' | ||
|
||
- name: Add ceph GPG key | ||
copy: | ||
src: ceph.asc | ||
dest: /etc/apt/keyrings/ansible-ceph.asc | ||
notify: Update apt | ||
when: 'ceph_roles|length > 0 and ceph_release != "distro"' | ||
|
||
- name: Get local architecture | ||
shell: dpkg --print-architecture | ||
register: dpkg_architecture | ||
changed_when: false | ||
check_mode: no | ||
when: 'ceph_roles|length > 0 and ceph_release != "distro"' | ||
|
||
- name: Add ceph package sources | ||
template: | ||
src: ceph.sources.tpl | ||
dest: /etc/apt/sources.list.d/ansible-ceph.sources | ||
notify: Update apt | ||
when: 'ceph_roles|length > 0 and ceph_release != "distro"' | ||
|
||
|
||
- name: Run all notified handlers | ||
meta: flush_handlers |
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,31 @@ | ||
--- | ||
|
||
- name: Import ceph GPG key | ||
ansible.builtin.rpm_key: | ||
state: present | ||
key: https://download.ceph.com/keys/release.asc | ||
when: 'ceph_roles|length > 0 and ceph_release != "distro"' | ||
|
||
- name: Configure ceph stable community repository | ||
ansible.builtin.yum_repository: | ||
name: ceph_stable | ||
description: Ceph Stable repo | ||
state: present | ||
baseurl: "https://download.ceph.com/rpm-{{ ceph_release }}/el{{ ansible_facts['distribution_major_version'] }}/$basearch" | ||
file: ceph_stable | ||
priority: 2 | ||
when: 'ceph_roles|length > 0 and ceph_release != "distro"' | ||
|
||
- name: Configure ceph stable noarch community repository | ||
ansible.builtin.yum_repository: | ||
name: ceph_stable_noarch | ||
description: Ceph Stable noarch repo | ||
state: present | ||
baseurl: "https://download.ceph.com/rpm-{{ ceph_release }}/el{{ ansible_facts['distribution_major_version'] }}/noarch" | ||
file: ceph_stable | ||
priority: 2 | ||
when: 'ceph_roles|length > 0 and ceph_release != "distro"' | ||
|
||
|
||
- name: Run all notified handlers | ||
meta: flush_handlers |
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,48 @@ | ||
--- | ||
- name: Create apt keyring path | ||
file: | ||
path: /etc/apt/keyrings/ | ||
mode: 0755 | ||
state: directory | ||
when: 'incus_roles|length > 0 and incus_release != "distro"' | ||
|
||
- name: Add Zabbly repository key | ||
copy: | ||
src: zabbly.asc | ||
dest: /etc/apt/keyrings/ansible-zabbly.asc | ||
notify: Update apt | ||
when: 'incus_roles|length > 0 and incus_release != "distro"' | ||
|
||
- name: Get DPKG architecture | ||
shell: dpkg --print-architecture | ||
register: dpkg_architecture | ||
changed_when: false | ||
check_mode: no | ||
when: 'incus_roles|length > 0 and incus_release != "distro"' | ||
|
||
- name: Add Zabbly package source | ||
template: | ||
src: incus.sources.tpl | ||
dest: /etc/apt/sources.list.d/ansible-zabbly-incus-{{ incus_release }}.sources | ||
notify: Update apt | ||
when: 'incus_roles|length > 0 and incus_release != "distro"' | ||
|
||
- name: Run all notified handlers | ||
meta: flush_handlers | ||
|
||
- name: Install the Incus package (deb) | ||
apt: | ||
name: | ||
- incus | ||
install_recommends: no | ||
state: present | ||
register: install_deb | ||
when: 'ansible_distribution in ("Debian", "Ubuntu") and incus_roles | length > 0' | ||
|
||
- name: Install the Incus UI package (deb) | ||
apt: | ||
name: | ||
- incus-ui-canonical | ||
install_recommends: no | ||
state: present | ||
when: 'ansible_distribution in ("Debian", "Ubuntu") and "ui" in incus_roles' |
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,16 @@ | ||
--- | ||
|
||
- name: Add COPR repository | ||
community.general.copr: | ||
chroot: "epel-9-x86_64" | ||
name: "neil/incus" | ||
state: enabled | ||
when: 'incus_roles|length > 0 and incus_release != "distro"' | ||
|
||
- name: Install the Incus package (rpm) | ||
ansible.builtin.package: | ||
name: | ||
- incus | ||
state: present | ||
register: install_rpm | ||
when: 'ansible_distribution == "CentOS" and incus_roles | length > 0' |
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,91 @@ | ||
--- | ||
- name: Create OVN config directory | ||
file: | ||
path: /etc/ovn | ||
mode: 0755 | ||
state: directory | ||
when: 'ovn_roles | length > 0' | ||
|
||
- name: Transfer OVN CA certificate | ||
copy: | ||
src: "{{ ovn_pki_path }}/ca.crt" | ||
dest: /etc/ovn/{{ ovn_name }}.ca.crt | ||
mode: 0644 | ||
when: 'ovn_roles | length > 0' | ||
|
||
- name: Transfer OVN server certificate | ||
copy: | ||
src: "{{ ovn_pki_path }}/{{ inventory_hostname }}.crt" | ||
dest: /etc/ovn/{{ ovn_name }}.server.crt | ||
mode: 0644 | ||
when: 'ovn_roles | length > 0' | ||
|
||
- name: Transfer OVN server key | ||
copy: | ||
src: "{{ ovn_pki_path }}/{{ inventory_hostname }}.key" | ||
dest: /etc/ovn/{{ ovn_name }}.server.key | ||
mode: 0600 | ||
when: 'ovn_roles | length > 0' | ||
notify: | ||
- Configure OVN central northbound DB for SSL (certs) | ||
- Configure OVN central northbound DB for SSL (ports) | ||
- Configure OVN central southbound DB for SSL (certs) | ||
- Configure OVN central southbound DB for SSL (ports) | ||
- Configure OVN IC northbound DB for SSL (certs) | ||
- Configure OVN IC northbound DB for SSL (ports) | ||
- Configure OVN IC southbound DB for SSL (certs) | ||
- Configure OVN IC southbound DB for SSL (ports) | ||
|
||
- name: Configure OVN central database | ||
template: | ||
src: ovn-central.tpl | ||
dest: /etc/default/ovn-central | ||
notify: | ||
- Restart OVN central | ||
- Configure OVN AZ name | ||
- Enable OVN IC route sharing | ||
when: '"central" in ovn_roles' | ||
|
||
- name: Configure OVN host | ||
template: | ||
src: ovn-host.tpl | ||
dest: /etc/default/ovn-host | ||
notify: | ||
- Restart OVN host | ||
when: '"host" in ovn_roles' | ||
|
||
- name: Create OVN IC override directory | ||
file: | ||
path: /etc/systemd/system/ovn-ic.service.d | ||
mode: 0755 | ||
state: directory | ||
when: '"ic" in ovn_roles' | ||
|
||
- name: Transfer OVN IC override | ||
copy: | ||
content: | | ||
[Service] | ||
EnvironmentFile=-/etc/default/ovn-ic | ||
ExecStart= | ||
ExecStart=/usr/share/ovn/scripts/ovn-ctl start_ic --no-monitor $OVN_CTL_OPTS | ||
dest: /etc/systemd/system/ovn-ic.service.d/ansible.conf | ||
notify: Restart OVN IC | ||
when: '"ic" in ovn_roles' | ||
|
||
- name: Configure OVN IC database | ||
template: | ||
src: ovn-ic.tpl | ||
dest: /etc/default/ovn-ic | ||
notify: | ||
- Restart OVN IC databases | ||
- Restart OVN IC | ||
when: '"ic" in ovn_roles or "ic-db" in ovn_roles' | ||
|
||
- name: Transfer OVN aliases | ||
template: | ||
src: alias.sh.tpl | ||
dest: /etc/ovn/alias.sh | ||
when: 'ovn_roles | length > 0' | ||
|
||
- name: Run all notified handlers | ||
meta: flush_handlers |
Oops, something went wrong.