I think your other thread to which I replied is related to this as well. 
Perhaps this example would be more 
helpful: 
https://github.com/danvaida/Ansible-Berlin-Meetup/blob/master/ansible-intro-examples/ghost.yml

On Friday, 20 February 2015 23:16:37 UTC+1, Nusenu wrote:
>
> Hi, 
>
> I'm having the problem that group_vars do not seem to be visible in the 
> role. I assumed it should be. 
>
>
> working: 
> ------------- 
>   tasks: 
>
>   - name: create groups based on pkg 
>     group_by: key={{ansible_pkg_mgr}} 
>
> # this one is defined in a group_var 
>   - debug: var=user1 
> ------------- 
>
>
> not working: 
> ------------- 
>   tasks: 
>
>   - name: create groups based on package manager 
>     group_by: key="{{ansible_pkg_mgr}}" 
>
>   roles: 
>     - role1 
> ------------- 
>
>
> role1 uses a variable 'user1' that is defined in group_vars/*, but when 
> running the playbook I get "undefined variables.." in places where a 
> task tries to access user1. 
>
> Is this expected? 
>
> thanks, 
> Nusenu 
>

-- 
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/41dbd263-e496-44cb-8402-3c87409a8490%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to