hosts syntax?

12 views
Skip to first unread message

Mike Eggleston

unread,
Nov 12, 2020, 11:18:40 AM11/12/20
to ansible...@googlegroups.com
Normally in my playbooks I say “hosts: all”. For a new playbook I want to say “hosts: !A,!B”, but that is not a valid syntax. What is the syntax to exclude two hosts (not in a group)?

Mike

Brian Coca

unread,
Nov 12, 2020, 12:01:53 PM11/12/20
to Ansible Project
You need something to negate

hosts: all:!A:!B


FYI all hosts are always in at least 2 groups, 'all' being always one
of them, if no other group is assigned 'ungrouped' becomes the 2nd.
--
----------
Brian Coca

Mike Eggleston

unread,
Nov 12, 2020, 12:08:03 PM11/12/20
to ansible...@googlegroups.com
Duh, thank you.

Mike
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7d6zdXHm9cDQXp-ygUU4qaNeu%3DF2JX0xUS-8qwh7bsgNg%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages