I mean Roles utilized after other roles.
I'm not going to read your git repo as we've been through this alot.
"I would love to see an explanation of why this works the way it does"
It's so you can have environmental role data like so:
- hosts: concord
roles:
- eastcoast_datacenter_config
- puppies
- hosts: lexington
roles:
- eastcoast_datacenter_config
- apache
- random_app
And define variables in roles and have those variables, like the name of an
NTP server, available further down.
On Wed, Jul 2, 2014 at 5:34 PM, Marc Abramowitz <[email protected]> wrote:
> On Tuesday, July 1, 2014 6:43:32 PM UTC-7, Michael DeHaan wrote:
>>
>> "Ansible variables seem to have a global scope, because if I set one
>> within the role it seems to be visible to all roles"
>>
>> No exactly true for roles.
>>
>> Ansible variables set in one role are available in roles further down so
>> you can have roles that describe an environment, but they do have scope.
>> In fact, you are guaranteed access to that particular value, without it
>> being clobbered.
>>
>
> When you say "further down", are you referring to:
>
> 1. further down in a hierarchy (i.e.: a parent/child relationship where
> role A depends on role B so that role B is "further down" than role A in a
> hierarchy)
> 2. further down in a sequential flow (i.e.: role A is applied and then
> role B so role B is "further down" in the playbook)
>
> ?
>
> Talking with a colleague, I was assuming #1 and he was assuming #2.
>
> I created a git repo that illustrates some behavior that surprised me.
> Most likely this is because I'm misunderstanding the paradigms at play;
> there's a small chance that it's a bug, but I figure the misunderstanding
> is more likely.
>
> https://github.com/msabramo/ansible-roles-example
>
> I would love to see an explanation of why this works the way it does so
> that I can have a deeper understanding of Ansible.
>
> Thanks!
> Marc
>
> --
> 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/d913befd-afde-4c1c-86a6-ea41523eef39%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d913befd-afde-4c1c-86a6-ea41523eef39%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].
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/CA%2BnsWgyLYtYRbT3G7CMiG_y4z%2BB%2BjGe-ZYnWszvHC9uZNJCSJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.