Hi,
It's seemed that variables defined in the group_vars are not visible to
playbooks. Then where should I keep the those variables?
Here is what I'm trying to do:
directory tree:
-----------------------
foo.yml
hosts
group_vars
..|-- all
..|__ g1
roles
..|-- bar
..|_ baa
foo.yml:
---------------------
---
- hosts: "{{ var1 }}"
remote_user: john
roles:
- bar
group_vars/all
---------------------
---
var1: my_cluster
var2: some_value
hosts
---------------------
[my_cluster]
n1.my.com
n2.my.com
The problem in the above configuration is, the variable "var1" in the
foo.yml cannot be resolved to "my_cluster" defined in group_vars/all . I
have to use the -e option of ansible-playbook explicitly. Is this how
ansible works ? And how to realize my above purpose ?
Thanks and Regards
John
--
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/8665de66-f536-4fd9-9314-e9433f4f5e6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.