Hi,
It’s look like i don’t understand perfectly when condition:
tasks:
-
set_fact:
sensu_remote_plugins: -
process-checks
-
http
-
disk-checks
-
memory-checks
-
load-checks
-
cpu-checks
-
io-checks
-
rabbitmq
-
network-checks
-
name: debug
debug:
var=sensu_remote_plugins
when: “‘aws’ in sensu_remote_plugins”
It’s work as expected, (skiping on this exemple) :
TASK [debug] **********************************************************************************************************************
skipping: [xxxx]
But i want a more complex when condition to filter with ansible_os_family
After sevral search, this when condition work’s for me :
when:
- ansible_os_family == “RedHat”
- “‘aws’ in sensu_remote_plugins”
TASK [debug] **********************************************************************************************************************
skipping: [xxxx]
But why these are not working ? :
when: ( ansible_os_family == “RedHat” and “‘aws’ in sensu_remote_plugins”)
TASK [debug] **********************************************************************************************************************
ok: [xxxx] => {
when: (“‘aws’ in sensu_remote_plugins”) and ansible_os_family == “RedHat”
TASK [debug] **********************************************************************************************************************
ok: [xxxx] => {
when: (“‘aws’ in sensu_remote_plugins”) and (ansible_os_family == “RedHat”)
TASK [debug] **********************************************************************************************************************
ok: [xxxx] => {
Thanks in advance
ansible 2.3.2.0