Skip to content

Commit

Permalink
Fix icinga2_objects secondary usage (#255)
Browse files Browse the repository at this point in the history
* fixes icinga2_objects variable usage
* adds changelog
  • Loading branch information
gianmarco-mameli authored Jan 16, 2024
1 parent 00d0608 commit de30b3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_issue_228.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- Fixed collect of icinga2_objects when icinga2_config_host is not defined (#228)
4 changes: 2 additions & 2 deletions roles/icinga2/tasks/objects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

- name: collect all config objects in play vars
set_fact:
tmp_objects: "{{ tmp_objects| default([]) + lookup('list', icinga2_objects[icinga2_config_host]) }}"
when: vars['icinga2_objects'][icinga2_config_host] is defined
tmp_objects: "{{ tmp_objects| default([]) + lookup('list', icinga2_objects) }}"
when: vars['icinga2_objects'][icinga2_config_host] is not defined

- icinga2_object:
args: "{{ item }}"
Expand Down

0 comments on commit de30b3e

Please sign in to comment.