I'm tipping my toe in the Ansible pool via a simple project deployment 
script. I have 3 environments (the usual dev, staging, production) and the 
deployment is exactly the same for each. In every example I've seen so far, 
the `hosts` are hard coded in the playbook. What I'd like to do is create a 
single `deploy.yml` file and specify the `hosts` value when I call it. 
Otherwise, at least in my limited understanding so far, we'll have to 
either modify the playbook every time we want to run a deployment against 
one of our environments.

I've seen something like this:

$ ansible deploy.yml -e "hosts=development"

where, in `deploy.yml`, we have `hosts: $hosts`, but that feels ham-fisted.

Is this the recommended/best approach? Should I be structuring things 
differently?

-- 
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].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7f3ec502-e07a-49a7-b287-e7f7f76e0857%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to