Skip to content

Commit 7da42d5

Browse files
authored
Merge pull request #411 from NETWAYS/fix/386-duplicate-objects
Deduplicate Icinga 2 objects before writing
2 parents 0e4cad9 + dd9a324 commit 7da42d5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minor_changes:
2+
- In the :code:`icinga2` role objects are collected from different places before writing them to files. Duplicates could occur which was not taken care of. All collected objects are now deduplicated using the :code:`unique` filter right before writing to save some time during execution.

roles/icinga2/tasks/objects.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
- icinga2_objects is not string
2424
- icinga2_objects is not mapping
2525

26+
- name: Remove duplicate objects from list
27+
ansible.builtin.set_fact:
28+
tmp_objects: "{{ (tmp_objects | default([])) | unique }}"
29+
2630
- icinga2_object:
2731
args: "{{ item }}"
2832
with_items: "{{ tmp_objects }}"

0 commit comments

Comments
 (0)