If I use var/main.yml for storing variables, all works fine (variables from
Role A and B seen in each role).
I want to symplify code in my roles and move generic code to separate role
or playbook. Then I want to pass some variables from roles to this playbook
(for creating directory structure, for example). I can't save output from
modules inside role A in variable and pass it to role B (even with set_fact
module inside one server I see facts onle inside the role, where I create
fact.)
среда, 5 августа 2015 г., 19:10:56 UTC+5 пользователь Dick Davies написал:
>
> On 5 August 2015 at 12:22, Stri}{ <[email protected] <javascript:>>
> wrote:
> > Hi,
> > How to set a variable inside role A and use it inside role B ? Role B is
> > listed in dependencies sections in meta/main.yml of role A and I see its
> > output then call role A.
>
> If role A depends on B, then B will get handled first, _then_ A.
>
> Any vars you set in B are visible in A, but not the other way round
> (since B happens 'before' A and you haven't had a chance to set those
> vars).
>
--
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/ecfd019b-9e54-4549-86c5-575bfcf26568%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.