Ansible roles don't have a way of defining pre and post tasks.

They are usually defined as a way to do things before applying generic
tasks/roles, like load balancing, and it would be a little confusing to
have them in the list of roles when some steps would be executed out of
order.




On Thu, Jul 10, 2014 at 10:42 AM, fokeyjo <[email protected]> wrote:

> Hiya,
>
> Hopefully this is an easy quick question.. I'm using the layout described
> in http://docs.ansible.com/playbooks_best_practices.html.
>
> I want to define a pre-task to a role defined in meta/main.yml, but I
> can't seem to do it. If my tasks/main.yml looks like this:
> ---
> pre_tasks:
> - name: Install virtualenv
>   yum: name=python-virtualenv state=present
>
> I get: ERROR: expecting dict; got: pre_tasks, error in
> <snip>/tasks/main.yml
>
> The page http://docs.ansible.com/playbooks_roles.html#roles seems to
> indicate that no other files or folders represent pre_tasks.
>
> So how do I define pre_tasks?
>
> Thanks,
>
> Fokeyjo
>
> --
> 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/90da8260-ebca-4749-b327-663bae0b7036%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/90da8260-ebca-4749-b327-663bae0b7036%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%2BnsWgzPrYJhohg4y6HJ69SREh0HBnmttL4Uv7DTxUni6SuOKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to