Suppose I want to blacklist a host of a group, in the inventory file, so as not to allow the running of any other tasks on it. How can i do it?
I do want it in my hosts list and later, after i run a playbook on it… i want to blacklist it, so that others cannot run on it.
We create a disabled group in our inventory file, that we add hosts to
when we want to blacklist them for some reason. For example:
[foobar]
example1
example2
example3
[disabled]
example2
Then in our playbooks we do the following:
- hosts: foobar:!disabled
tasks:
...
This would be example1 and example3 would run, but example2 would not.
- Paul