Serge, Thanks for the information. In order to exclude a hostname called "mailserver", would I simply add a hosts line like this to the top of the postfix role's tasks/main.yml? - hosts:!mailserver - name: task1 ... - name: task2 ... Will this override the list of hosts that I provide to the playbooks that include this role?
Thanks, Andrew On Friday, 6 December 2013 12:41:08 UTC-6, Serge van Ginderachter wrote: > > > > Is it possible to prevent a playbook, role, or even specific task from >> being run on a certain list of hostnames (or group)? I have a generic >> playbook for configuring postfix for sending emails, however I don't want >> this playbook to ever be run against a mail server (which has a different >> postfix configuration). The idea behind blacklisting it in the playbook >> itself is so that if someone accidentally runs "ansible-playbook all >> postfix.yml" it won't override the configuration on the mail servers. Can >> this be done? >> > > Yes, see http://www.ansibleworks.com/docs/intro_patterns.html : > > > You can exclude groups as well, for instance, all machines must be in the > group webservers but not in the group phoenix: > > webservers:!phoenix > > -- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
