I think you can still include another playbook in your playbook by using 
'include' and the name of the playbook.  Would that do? It would save you 
having to create any custom code.

If you want you can even do a basic kind of parallel running of playbooks.  
 See the examples here Slides 
20-25 https://www.slideshare.net/bcoca/more-tips-n-tricks

Jon

On Friday, October 13, 2017 at 9:44:58 AM UTC+1, Frank Kaiser wrote:
>
> Hi Guys,
>
> I want to include another playbook in my playbook.
>
> Ansible allows to do this by using "include_role" like so:
>
> - include_role:
>     name: <role-name>
>     task_from: <task-file-name>
>
> While this is a simple and working solution I want to offer a shorter 
> syntax like so:
>
> - <mycommand>:
>
> This would then internally call role:task-file, but hidden to the playbook 
> writer, giving a cleaner syntax.
>
> The proper way to achieve this seems to be writing an action plugin named 
> "<mycommand>.py".
> This plugin then in turn calls the playbook, possibly by internally 
> calling include_role.
>
> My question is:
>
> Can someone show how to call "include_role" from inside an action plugin?
> I have tried but so far without success. (I was however able to call other 
> modules)
>
> I am using Ansible 2.0+
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to