What's the sane way run a task only if the host belongs to one or more groups?
Currently, I'm using a boolean within the relevant group, e.g.:
Inventory file
[db_servers:vars]
copy_connection_string=true
Task
-
name: Copy db connection string file
synchronize: src= ... (truncated for clarity)
when: copy_connection_string is defined
What's the right condition in the when
clause to check whether the current host belongs to the db_servers
group?