I want to run a task to all hosts if at least one of the hosts has a variable “new_node”.
For example i have inventory
[all] host1.example.net host2.example.net host3.example.net new_node=True
And if in one of the hosts has variable “new_node=True”
then run this task on all hosts
--- - hosts: all tasks: - name: Create file yep at all hosts file: path: /tmp/yep state: file
What condition or filter should i apply? Any ideas. Thanks