So a couple of things --

I don't think you want a

B/
   tasks/
   main/

For A and B, we established that there are 2 roles for each-- install
and configure.  Even though they are sub directories to A & B,  don't
inherit anything (as in, they don't get vars from the parent role
because there's no such thing).  They are fully separate roles.

If you simply want to maintain different variables for different host
groups, you should be using group_vars/group_name which will supersede
group_vars/all.

In other words:

set
inventory/group_vars/all:
world: people

inventory/group_vars/B:
world: daleks

Tell me what you expect the output to be, and we can work to figure
out how to make it so.


- James


On Thu, Dec 12, 2013 at 5:08 PM, Dmitry Makovey <[email protected]> wrote:
>
> On Thursday, December 12, 2013 7:13:28 AM UTC-7, James Martin wrote:
>>
>> Dmitry,
>>
>> Can you explain what you mean in more detail "if prior to call to
>> B/install tasks I call B tasks -  "foo" gets populated with
>> /roles/B/vars/main.yml, otherwise it picks up /group_vars/all".
>>
>> Examples of playbooks on github would be helpful.
>
>
> there you go:
>
> https://github.com/droopy4096/ansible-nested-roles
>
> in
> https://github.com/droopy4096/ansible-nested-roles/blob/master/install.yml
> line "9" is the "trigger" line.
>
> launch
>
> ansible-playbook -v -u root  -i inventory install.yml
>
> and you'll see that echo prints "Hello Darleks", now comment above line 9 in
> install.yml and run the same... it'll say "Hello people"
>
> variable world is defined in several places group_vars/all ("people") and
> roles/B/vars/main.yml ("Darleks")
>
> you see what I mean?
>
> --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to