I do this by having a per-environment inventory, each of which has its
own group_vars/all.
e.g.
production/hosts
production/group_vars/all
staging/hosts
staging/group_vars/all
dev/hosts
dev/group_vars/all
and so on. Then invoke the same play against each environment like :
ansible-playbook -i production/ site.yml
If you want you could have a file per environment with an [all:vars]
section laid out like this:
production_hosts
staging_hosts
dev_hosts
called with
ansible-playbook -i production_hosts site.yml
and do away with your group_vars/all altogether.
> --
> 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 post to this group, send email to
ansible...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/5bfaebf7-5aba-4eaf-b6af-27b248aef649%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.