This is an old revision of the document!
If you are like me, then your Ansible world is not ideal. Separate environments force you operating on multiple inventories. These multiple inventories have a caveat that some hosts like monitoring, log forwarding, jump stations, etc. are common boxes at the edge of these environments. Boxes like these should be excluded from from applying the configuration multiple times, once for each environment.
There is an undocumented feature in ansible-playbook
, which allows you to exclude the host. I have never found this anywhere in docs nor any of the books I have, so here it is:
ansible-playbook -i <inventory> playbook.yml –limit='!hostname'
You can verify the host list with –list-hosts
flag:
ansible-playbook -i <inventory> playbook.yml –limit='!hostname' –list-hosts