Skip to content

Commit

Permalink
fix handler invocation
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Katharina Brechtel <[email protected]>
  • Loading branch information
mkbrechtel committed May 18, 2024
1 parent ea479bf commit e6ef89d
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 17 deletions.
8 changes: 8 additions & 0 deletions roles/ceph/handlers/main.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---

- name: Update apt
apt:
force_apt_get: yes
update_cache: yes
cache_valid_time: 0

- name: Add key to client.admin keyring
delegate_to: 127.0.0.1
shell:
Expand Down
20 changes: 13 additions & 7 deletions roles/ceph/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
notify: Add nodes to mon map
when: 'ceph_fsid'

- name: Run all handlers
ansible.builtin.meta: flush_handlers

# - name: Ceph - Add package repository
- name: Create apt keyring path
file:
Expand All @@ -47,7 +50,7 @@
copy:
src: ceph.asc
dest: /etc/apt/keyrings/ansible-ceph.asc
#notify: Update apt
notify: Update apt
when: 'ceph_roles|length > 0 and ceph_release != "distro"'

- name: Get DPKG architecture
Expand All @@ -61,14 +64,11 @@
template:
src: ceph.sources.j2
dest: /etc/apt/sources.list.d/ansible-ceph.sources
#notify: Update apt
notify: Update apt
when: 'ceph_roles|length > 0 and ceph_release != "distro"'

- name: Update apt
apt:
force_apt_get: yes
update_cache: yes
cache_valid_time: 0
- name: Run all handlers
ansible.builtin.meta: flush_handlers

# - name: Ceph - Install packages
- name: Install ceph-common
Expand Down Expand Up @@ -213,6 +213,9 @@
mode: 0660
when: '"osd" in ceph_roles'

- name: Run all handlers
ansible.builtin.meta: flush_handlers

# - name: Ceph - Deploy mon
- name: Bootstrap Ceph mon
shell:
Expand All @@ -230,6 +233,9 @@
state: started
when: '"mon" in ceph_roles'

- name: Run all handlers
ansible.builtin.meta: flush_handlers

# - name: Ceph - Deploy osd
- name: Bootstrap Ceph OSD
shell:
Expand Down
8 changes: 8 additions & 0 deletions roles/incus/handlers/main.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---

- name: Update apt
apt:
force_apt_get: yes
update_cache: yes
cache_valid_time: 0

- name: Restart Incus
systemd:
name: incus.service
Expand Down
10 changes: 5 additions & 5 deletions roles/incus/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@
notify: Update apt
when: 'incus_roles|length > 0 and incus_release != "distro"'

- name: Update apt
apt:
force_apt_get: yes
update_cache: yes
cache_valid_time: 0
- name: Run all handlers
ansible.builtin.meta: flush_handlers

# - name: Incus - Install packages and bootstrap
- name: Install the Incus package
Expand Down Expand Up @@ -158,3 +155,6 @@
key: {{ key }}
value: {{ incus_init.network[network].local_config[key] }}{% endfor %}{% endfor %}
when: 'cluster_add.changed'

- name: Run all handlers
ansible.builtin.meta: flush_handlers
7 changes: 7 additions & 0 deletions roles/ovn/handlers/main.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
- name: Update apt
apt:
force_apt_get: yes
update_cache: yes
cache_valid_time: 0

- 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 }}

Expand Down
13 changes: 8 additions & 5 deletions roles/ovn/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,8 @@
notify: Update apt
when: 'ovn_roles|length > 0 and ovn_release == "ppa"'

- name: Update apt
apt:
force_apt_get: yes
update_cache: yes
cache_valid_time: 0
- name: Run all handlers
ansible.builtin.meta: flush_handlers

# - name: OVN - Install packages
- name: Install the OVN central package
Expand Down Expand Up @@ -143,6 +140,9 @@
- Enable OVN IC gateway
when: '"host" in ovn_roles'

- name: Run all handlers
ansible.builtin.meta: flush_handlers

# - name: OVN - Set up daemon configuration
- name: Create OVN config directory
file:
Expand Down Expand Up @@ -231,3 +231,6 @@
src: alias.sh.j2
dest: /etc/ovn/alias.sh
when: 'ovn_roles | length > 0'

- name: Run all handlers
ansible.builtin.meta: flush_handlers

0 comments on commit e6ef89d

Please sign in to comment.