Explorar o código

Using better syntax for check plugin conditional loop

cmacrae %!s(int64=9) %!d(string=hai) anos
pai
achega
453111f72f
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  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