Skip to content

Commit

Permalink
Fix module configuration task order (#254)
Browse files Browse the repository at this point in the history
* changed order, to enable/disable modules before configuration.

* added bugfix changelog #225
  • Loading branch information
mkayontour authored Jan 5, 2024
1 parent 343415d commit fca0a47
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_change_order_of_module_tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- "Icingaweb2: Change order of module state and configuration tasks #225"
14 changes: 8 additions & 6 deletions roles/icingaweb2/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@
ansible.builtin.include_tasks: "manage_icingaweb_{{ icingaweb2_db.type }}_db.yml"
when: icingaweb2_db is defined

- name: Configure modules
ansible.builtin.include_tasks: "modules/{{ item.key }}.yml"
when: icingaweb2_modules is defined
loop: "{{ icingaweb2_modules | dict2items }}"

- name: Manage enabled/disabled modules
- name: Manage module states
ansible.builtin.file:
src: "{{ icingaweb2_config.global.module_path + '/' + item.key if item.value.enabled|bool == true else omit }}"
dest: "{{ icingaweb2_config_dir }}/enabledModules/{{ item.key }}"
Expand All @@ -43,6 +38,13 @@
force: yes
when: icingaweb2_modules is defined
loop: "{{ icingaweb2_modules | dict2items }}"
loop_control:
label: "Ensure {{ item.key }} is {{ 'enabled' if item.value.enabled|bool == true else 'disabled' }}"

- name: Configure modules
ansible.builtin.include_tasks: "modules/{{ item.key }}.yml"
when: icingaweb2_modules is defined
loop: "{{ icingaweb2_modules | dict2items }}"

# Many daemons fail before e.g. the resource is set up or the schema hasn't been migrated. This is a workaround.
- name: Manage enabled module daemons
Expand Down

0 comments on commit fca0a47

Please sign in to comment.