Hello Vladimir, thank you for the response! My understanding was that group_vars needed to be in the same directory as the inventory to work, but in your example it looks like group_vars is one directory up, is that correct?
On Saturday, May 9, 2020 at 5:32:49 PM UTC-6, David Sudia wrote: > > Here is my directory structure: > > dba.yml (a playbook) > inventory/ > union.gcp.yml (a dynamic gcp inventory) > group_vars/ > all/ > vars.yml > vault.yml > dba/ > vars.yml > roles/ > someroleshere/ > > The command I'm running is > $ ansible-playbook -i inventory --vault-password-file=/path/to/file dba. > yml > > Ansible reads my inventory just fine and connects to correct VM. The first > variable it wants is > disks > which is an array of dicts to format and mount. > > Whether I put disks in the dba/vars.yml (the correct place for it to be) > or all/vars.yml, Ansible gets to that variable and says it's undefined. > > I have this big messy Ansible repo where everything works but it's a mess, > that I'm starting fresh on because I read back through the docs and > realized I wasn't following any best practices, and now I'm trying to > follow them to the letter and can't get it to work. > > Any help appreciated, 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ca7cf2be-ebc6-4e20-9b23-47fdd2b33744%40googlegroups.com.
