Skip to content

Commit

Permalink
fix: Handle undefined item in pmie configuration
Browse files Browse the repository at this point in the history
When a file does not exist, the item.found in
__pcp_global_webhook_action_status does not need to be defined.
This comit handle such a situation.
  • Loading branch information
kurik committed Jul 19, 2024
1 parent b86f996 commit 30be2be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions roles/pcp/tasks/pmie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
loop: "{{ __pcp_global_webhook_action_status.results }}"
changed_when:
- pcp_pmie_endpoint | length > 0
- item.found == 0
- item.found is defined and item.found == 0
when:
- pcp_pmie_endpoint | length > 0
- item.found == 0
- item.found is defined and item.found == 0
register: __pcp_register_changed_actions_for_hosts
# yamllint enable rule:line-length

Expand All @@ -76,10 +76,10 @@
loop: "{{ __pcp_global_webhook_endpoint_status.results }}"
changed_when:
- pcp_pmie_endpoint | length > 0
- item.found == 0
- item.found is defined and item.found == 0
when:
- pcp_pmie_endpoint | length > 0
- item.found == 0
- item.found is defined and item.found == 0
register: __pcp_register_changed_actions_for_hosts
# yamllint enable rule:line-length

Expand Down

0 comments on commit 30be2be

Please sign in to comment.