I want to limit an ansible run to all webservers which are not in the windows group. I get this done when I create a new group:
[test]
webservers:!windows
and run it like this:
ansible-playbook -i inventories/staging/ site.yml --limit test
But when I try to avoid the group definition and put all into the limit statement it fails with !windows event not found
ansible-playbook -i inventories/staging/ site.yml --limit "webservers:!windows"
Is this not supported or do I something wrong?
!
is a special character in bash
to expand previous commands.
You should use single quotes to avoid bash expansion: --limit 'webservers:!windows'