Well, I'm already doing that inside *other_role*; however, I'm guessing if
I make *other_role* a dependency of this other role and pass *some_var*,
it's still going to try to execute all other tasks in *other_role*,
including all other ones defined in their own yml and included in
*other_role* main.yml
Unless you're suggesting I somehow include this yml file that exists in
*other_role* in the main.yml of the role that is dependent upon this task.
And to be clear, I'm trying to make this happen so that I don't have to
recreate this task in this other role.
On Thursday, July 2, 2015 at 10:17:43 AM UTC-4, Strahinja Kustudić wrote:
>
> What you could do is group those task into a separate yml file and then
> include them in the main.yml:
>
> include: some_var_tasks.yml
> when: some_var
>
>
>
> On Thursday, July 2, 2015 at 4:15:54 PM UTC+2, Jacob Seeley wrote:
>>
>> That's unfortunate. That would require me to set variables in all tasks
>> on *other_role* that I would not have otherwise set, just so that I can
>> pass a variable that triggers one task in *other_role*.
>>
>> On Thursday, July 2, 2015 at 9:52:27 AM UTC-4, Strahinja Kustudić wrote:
>>>
>>> Ansible doesn't support role dependency using tags. Tags are only used
>>> for executing specific tasks which can be passes from the command line.
>>>
>>> To do what you want, you would have to define a variable in the
>>> other_role and set a when: clause on all tasks when that variable is true,
>>> or set.
>>>
>>> On Thursday, July 2, 2015 at 3:46:21 PM UTC+2, Jacob Seeley wrote:
>>>>
>>>> Hello,
>>>>
>>>> I'd like to have one role be dependent upon another role's tag only.
>>>> Here is what I am trying:
>>>>
>>>> # meta/main.yml
>>>>
>>>> ---
>>>>
>>>> dependencies:
>>>> - { role: common }
>>>> - { role: other_role, tags: ['other_role_autofs'] }
>>>>
>>>>
>>>>
>>>> *Expected Behaviour*All tasks in the role *common* are run
>>>> Only the role *other_role*' task with a tag of *other_role_autofs* is
>>>> run
>>>>
>>>>
>>>> *Actual Behaviour*
>>>> All tasks in the role *common* are run
>>>> All tasks in the role *other_role *are run
>>>>
>>>
--
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/fd19cb95-b0d3-4f84-9ed3-9d7ad04ba759%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.