Skip to content

Commit

Permalink
Merge pull request #313 from Icinga/fix/309-custom-config-sub-directo…
Browse files Browse the repository at this point in the history
…ries

Add ability to use nested directories for config
  • Loading branch information
Donien authored Dec 5, 2024
2 parents d9efd5c + b0648ba commit 6e2b632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/fix_issue_309.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "When using :code:`icinga2_custom_config` sub directories within the found :code:`files/` directory can now be used to deploy Icinga 2 configuration. This allows users to freely structure their :code:`files/` directory (nested directories) (#309)."
4 changes: 2 additions & 2 deletions roles/icinga2/tasks/objects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
block:
- name: construct _icinga2_custom_conf_paths
set_fact:
_icinga2_custom_conf_paths: "{{ _icinga2_custom_conf_paths + [ icinga2_fragments_path + '/' + item.path + '/' + item.order|default('20')|string + '_' + item.name] }}"
_icinga2_custom_conf_paths: "{{ _icinga2_custom_conf_paths + [ icinga2_fragments_path + '/' + item.path + '/' + item.order|default('20')|string + '_' + (item.name | replace('/', '_'))] }}"
loop: "{{ icinga2_custom_config }}"

- name: prepare custom config paths
Expand All @@ -57,5 +57,5 @@
group: root
mode: 0644
src: "files/{{ item.name }}"
dest: "{{ icinga2_fragments_path }}/{{ item.path }}/{{ item.order|default('20')|string }}_{{ item.name }}"
dest: "{{ icinga2_fragments_path }}/{{ item.path }}/{{ item.order|default('20')|string }}_{{ item.name | replace('/', '_') }}"
loop: "{{ icinga2_custom_config }}"

0 comments on commit 6e2b632

Please sign in to comment.