Hi,
I am writing an inventory that contains 3 groups of hosts, and each of them
have their own host specific variables. It looks like this:
[abc]
10.10.0.101
10.10.0.102
[abc:vars]
dest_path=/home/wwwroot/abc
port=4100
appname=abc
[efg]
10.10.0.10
10.10.0.11
[efg:vars]
dest_path=/home/wwwroot/efg
port=4100
appname=efg
[xyz]
10.10.0.10
10.10.0.11
[xyz:vars]
dest_path=/home/wwwroot/xyz
port=3001
appname=xyz
I run a test playbook, and always get the wrong variables. the playbook
looks:
---
- hosts: "{{ target_hosts }}"
user: webapps
tasks:
- name: test vars
debug: msg="{{ target_hosts }} has name {{ appname }} and port {{
port }} and {{ dest_path }}"
and I run it like this: ansible-playbook -i inventory test.yml -e
"target_hosts=efg". I tried with all the 3 groups, but it always give me
the same anwser: "prd has name efg and port 4100 and /home/wwwroot/efg".
Ansible: 1.9.2
OS: centos 6.2
Please help!
Thanks!
--
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/b0e9546d-3f29-49ed-9c28-b3102c82d4bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.