Skip to content

Commit

Permalink
changed order, to enable/disable modules before configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkayontour committed Jan 5, 2024
1 parent 343415d commit 9288121
Showing 1 changed file with 8 additions and 6 deletions.
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 9288121

Please sign in to comment.