I'd sent the playbook off-list, but I've now filed a github ticket with a more succinct example case.
For now as a workaround I'm going to try explicitly importing group_vars/all in cases where this happens, though I'm a little curious what will happen (merge/overwrite with identical, etc.) to the vars once the issue I'm seeing is no longer happening. Thank you, Mark On Tuesday, March 18, 2014 11:48:56 AM UTC-5, James Tanner wrote: > > Can we see the second playbook? > > On 03/18/2014 12:46 PM, Michael DeHaan wrote: > > The implicit localhost feature is new, and it's not technically part of > any group, so I'm not too surprised it doesn't read group variables for the > host. > > If you'd like to file a github ticket we can look into making sure it > gets variables from the "all" group. > > > > > > > On Tue, Mar 18, 2014 at 12:44 PM, Mark Casey <[email protected]<javascript:> > > wrote: > >> Hello list, >> >> I think I'm seeing "group_vars/all" get skipped for implicit localhost >> when using the ec2.py inventory script. I've tried writing a few simplified >> example plays but they all worked, so I'm either missing something obvious >> or the issue was in a part I tried to stub out. So here is what I hope will >> be a succinct verbal description instead... >> >> I'm working on an ec2 deployment that has a few playbooks that are run by >> separate calls to ansible-playbook, via a pretty simple bash wrapper >> script. The first call to ansible-playbook creates the ec2 instances pretty >> normally, getting vars like account credentials and instance type from >> group_vars/all. Then we return to our bash wrapper which does a bunch of >> work while the instances start, and then makes a separate call to >> ansible-playbook (this time using -i ec2.py) that configures the instances. >> It is in this second call to ansible-playbook that I'm getting errors that >> my vars to access ec2 are not defined. >> >> I think the culprit is in using a dynamic inventory because I tried >> specifying ec2.py for the first (instance creation) ansible-playbook call >> too, and it also started failing saying vars were undefined. >> >> This is roughly what the bash script is doing at the time: >> >> # Request the instances, don't wait for them >> ansible-playbook -f 25 create_instances.yml --private-key=key -e "stuff >> like fqdn of site, server-group name, etc, wait=no" >> >> #prep composer and npm type dependencies on build server while waiting >> for instances >> ec2.py --refresh-cache &>/dev/null >> >> # Provision instances in their respective roles >> ansible-playbook -f 25 -i ec2.py provision_instances.yml >> --private-key=key -e "stuff like fqdn of site, server-group name, etc, >> wait=yes" >> >> >> Any insights much appreciated. >> >> Thank you, >> Mark >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/3f05daac-38ee-4ebd-90d5-d0704bc86115%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/3f05daac-38ee-4ebd-90d5-d0704bc86115%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > 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] <javascript:>. > To post to this group, send email to [email protected]<javascript:> > . > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/CAEVJ8QNOeMP9GPVKVxLiVWp1opNKb5LnJ0PwkVnhcmUdAD-sZA%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CAEVJ8QNOeMP9GPVKVxLiVWp1opNKb5LnJ0PwkVnhcmUdAD-sZA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > -- 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/359f5b1b-fe08-48e1-9042-71232c92cf47%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
