Hi,

I am trying to select hosts for a play based on a variable passed at job 
launch time in Tower:

hosts: "{{ project_name }}-masters:{{ project_name }}-slaves"

This will allow me to create and administer different stacks separately 
within the same Rackspace account.

I have read elsewhere that inventory variables are different to variables 
created in the playbook, but that a variable passed on the command-line 
with -e should be available to use with hosts: in a play.
I have project_name set up as an extra variable in the job template in 
Tower but this doesn't have the desired effect.
The plays with hosts referenced in this way all skip through with "no hosts 
matched".
I can see in the std-out that the project_name variable is correctly formed.

Is there a way I can define my hosts based on a variable like this?
If not the only workaround I can think of is to have to have a new playbook 
for each project with the project name hard-coded.

Best regards,
David

-- 
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/9fbf8537-9071-4e0c-b355-a7e78edc315f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to