Skip to content

Commit

Permalink
Merge pull request #209 from michaelpporter/master
Browse files Browse the repository at this point in the history
Fixes loop issue #208
  • Loading branch information
jaredledvina authored Feb 19, 2019
2 parents 88c0e22 + cca604d commit 45b9384
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions docs/dynamic_checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ With this pair of plays, in the `tasks/plugins.yml` playbook:
owner: "{{ sensu_user_name }}"
group: "{{ sensu_group_name }}"
when: "'{{ item }}' in sensu_available_checks.stdout_lines"
loop:
- group_names|flatten
loop: "{{ group_names|flatten }}"
notify: restart sensu-client service
```
This will [register](https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#register-variables) a list of available checks, then deploy them to their intended groups based on node membership, as set within the Ansible inventory.
Expand All @@ -129,8 +128,7 @@ These are deployed with the following pair of plays, also in the `tasks/plugins.
owner: "{{ sensu_user_name }}"
group: "{{ sensu_group_name }}"
when: "sensu_available_client_definitions is defined and item in sensu_available_client_definitions.stdout_lines"
loop:
- "{{ group_names|flatten }}"
loop: "{{ group_names|flatten }}"
notify: restart sensu-client service
```

Expand Down
6 changes: 2 additions & 4 deletions tasks/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
- sensu_available_checks is defined
- sensu_available_checks is not skipped
- item in sensu_available_checks.stdout_lines
loop:
- "{{ group_names|flatten }}"
loop: "{{ group_names|flatten }}"
notify: restart sensu-client service

- name: Deploy handler plugins
Expand Down Expand Up @@ -112,6 +111,5 @@
- sensu_available_client_definitions is defined
- sensu_available_checks is not skipped
- item in sensu_available_client_definitions.stdout_lines
loop:
- "{{ group_names|flatten }}"
loop: "{{ group_names|flatten }}"
notify: restart sensu-client service

0 comments on commit 45b9384

Please sign in to comment.