Playbooks are parsed all at once, and roles which are "static", are merged
into the play at parsing time.  They are required to exist before the
playbook runs.  You could however switch to `include_role`, which loads the
role when that "task" is encountered.

On Fri, Mar 20, 2020 at 10:17 AM Johanna Galarza <[email protected]>
wrote:

> This is my current setup
> ---
> - hosts: all
>   pre-tasks:
>     - local_action:
>         command ansible-galaxy install -r requirements.yml -p . (this
> install roles roleA, roleB, roleC)
> roles:
> - role1
> - role2
>
> I have always an error message that it says that role1 doesn't exist...
> and I cannot see the first command being executed even with a debug message
> - so I have the feeling it is always executing roles first and then
> pre-tasks, however, I read that pre-task will be run first.... why does
> this doesn't apply here?
>
> Any idea?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/884e2977-1bdc-480b-a434-cf820b456815%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/884e2977-1bdc-480b-a434-cf820b456815%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v-Hf6A5M4uZwSPCUepSu%3DjH96yYSV%2Bye%2BXU5j8Np_bfQw%40mail.gmail.com.

Reply via email to