Hi Peter,

I've found that when you start wanting to invoke sections of a role
independently, that's usually the time that you should break that role up
into multiple separate roles. This makes reuse and separate execution much
easier. You can have a structure that looks like this, too:

roles/aws/net/tasks/main.yml
roles/aws/vm/tasks/main.yml
...for nice nested organization of roles.

You can then call the roles individually, and if you need to, use role
dependencies to enforce one to run before another.

Hope this helps,

-Tim

On Thu, Jan 15, 2015 at 12:33 PM, Peter Mooshammer <[email protected]>
wrote:

> Hi,
>
> I have a role that does everything to standup a server on aws - create a
> network and provision a VM. But sometimes I only want to run only the part
> that deploys a new server.
>
> Currently I simple include these sub-tasks in a playbook, which I don't
> really like:
>
>   tasks:
>     # should be called as a role, but only parts of it ...
>   - include: aws/tasks/provision-net.yml
>   - include: aws/tasks/provision-vm.yml
>
> thanks
>
>
>

-- 
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/CAH4wdVWCaq89U9qCqYERVBKGCd4_ksGN5ZG%2BOzO--tOb0JjoRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to