On Friday, January 20, 2017 at 2:27:22 PM UTC-7, Kai Stian Olstad wrote:
>
> On 20. jan. 2017 21:32, Elliott Barrere wrote: 
> > 
>
> So this did work at some point? 
> If so did it stop after you upgraded, if thats the case does it work if 
> you downgrade to the last working version? 
>

It did work at some point, and I believe it stopped working immediately 
after the upgrade.

Good point, I forgot I can simply check out an older version from Git to 
force an older version of Ansible.  I will try that in a bit if other 
options don't work.
 

>
>
> >> In the same directory as you inventory file, output of these commands 
> >> would help track it down. 
> >> tree -L 3 
> >> 
> > $ tree -L 3 
> > . 
> > 
> > ├── ansible.cfg 
> > ├── group_vars 
> > ├── host_vars 
> > ├── inventory 
>
> > ├── site.yaml 
>
> I think I see what could be a problem. 
> I guess you are running ansible-playbook from the directory ansible.cfg 
> is in, and running someting like this? 
>
> ansible-playbook -i inventory/<sonething> playbooks/linux/linux.yaml 
>

That is correct, but I am also specifying -l and --tags to limit scope for 
testing.
 

>
> The reason I ask is that host_vars and group_vars must be in the same 
> directory as the inventory or playbooks[1] 
>
> And here they are on the top level, so only site.yml is able to use 
> host_vars and group_vars in your layout. 


> If you move the playbook you have problem with to the same level as 
> site.yml, does it work? 
>

Aha!  That indeed fixes it.  I guess we were relying on some deprecated 
functionality that disappeared when we upgraded.

I have now moved playbooks/linux/linux.yaml to ./linux.yaml for testing, 
but this is obviously not a great long-term solution (we have a lot of 
playbook files, and we like to organize them with directories).  I have 
tried moving the host_vars and group_vars directories underneath the 
./playbooks and ./inventory directories respectively, but neither of those 
locations work either (probably because each contains a sub-directory that 
contains the .yaml files themselves)

What is the recommended directory structure for this type of setup, 
allowing us to keep an organized subdirectory structure?
 

>
> > $ ansible --version 
> > 
> > ansible 2.3.0 (devel 92a568c816) last updated 2017/01/20 13:14:32 (GMT 
> -600) 
> >  config file = 
> >  configured module search path = Default w/o overrides 
>
> Did you run this the the ansible directory, it should have displayed the 
> path to ansible.cfg in "config file", but yours is empty. 
>
>
It looks like I ran this from a subdirectory before.  When I run from the 
ansible directory the "config file" value is displayed correctly.


> [1] 
>
> https://docs.ansible.com/ansible/intro_inventory.html#splitting-out-host-and-group-specific-data
>  
>
> -- 
> Kai Stian Olstad 
>

-- 
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/976c8450-3d6e-46ae-80c2-1919bf3094b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to