Browse Source

Using better syntax for check plugin conditional loop

cmacrae 9 years ago
parent
commit
453111f72f
2 changed files with 2 additions and 2 deletions
  1. 1 1
      docs/dynamic_checks.md
  2. 1 1
      tasks/plugins.yml

+ 1 - 1
docs/dynamic_checks.md

@@ -87,7 +87,7 @@ With this pair of plays, in the `tasks/plugins.yml` playbook:
       mode: 0755
       owner: "{{ sensu_user_name }}"
       group: "{{ sensu_group_name }}"
-    when: sensu_available_checks.stdout.find('{{ item }}') != -1
+    when: "'{{ item }}' in sensu_available_checks.stdout"
     with_flattened:
       - group_names
     notify: restart sensu-client service

+ 1 - 1
tasks/plugins.yml

@@ -29,7 +29,7 @@
       mode: 0755
       owner: "{{ sensu_user_name }}"
       group: "{{ sensu_group_name }}"
-    when: sensu_available_checks.stdout.find('{{ item }}') != -1
+    when: "'{{ item }}' in sensu_available_checks.stdout"
     with_flattened:
       - group_names
     notify: restart sensu-client service