I forgot to mention that `import_tasks` or `include_tasks` also results in 
the undefined alias error.

On Saturday, November 10, 2018 at 2:50:05 PM UTC+1, Nick Kakouros wrote:
>
> Thanks. In that case, could I add a task to a play programmatically? I 
> have around 20 plays and I try to have the vars section of each play to be 
> saved locally to a yaml file. Right now, at the end of each play, I use a 
> 'copy' tasks that reads the vars via a yaml alias. I would like to not 
> repeat myself. I tried to place this task in a different play that is run 
> after each one of the above plays , but ansible complains about an 
> undefined alias. Do you see any way to not have to repeat the task in every 
> play?
>
> On Saturday, November 10, 2018 at 2:01:09 AM UTC+1, Brian Coca wrote:
>>
>> You cannot, play vars are only in scope for that play. The only vars 
>> in a playbook you can reference across all plays are host vars. 
>>
>>
>>
>>
>> -- 
>> ---------- 
>> Brian Coca 
>>
>

-- 
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/a8d59546-2845-4844-b718-fd277d9b5fb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to