Does having nested playbooks make sense

155 views
Skip to first unread message

Tom Ekberg

unread,
May 5, 2014, 5:17:47 PM5/5/14
to ansible...@googlegroups.com
One of the tasks in my provision playbook is to loop through the printers, and install each one. I wrote a script to do that (mkdir, download, install, check) and thought it might be better to use YML instead of BASH. Does it make sense for my provision playbook to invoke my install_printer playbook, passing variables (IP address, printer name, etc.) each time through the loop? I suppose I could just use the command module to call ansible-playbook. I was thinking there might be a better way.

Does having one playbook invoke another playbook make sense?

Michael DeHaan

unread,
May 5, 2014, 11:46:49 PM5/5/14
to ansible...@googlegroups.com
No, but including a list of plays in a playbook or a list of task includes is a common pattern.

Having a role named "printer" could make good sense.

Calling ansible-playbook from ansible-playbook should never be required.



On Mon, May 5, 2014 at 5:17 PM, Tom Ekberg <tek...@gmail.com> wrote:
One of the tasks in my provision playbook is to loop through the printers, and install each one. I wrote a script to do that (mkdir, download, install, check) and thought it might be better to use YML instead of BASH. Does it make sense for my provision playbook to invoke my install_printer playbook, passing variables (IP address, printer name, etc.) each time through the loop? I suppose I could just use the command module to call ansible-playbook. I was thinking there might be a better way.

Does having one playbook invoke another playbook make sense?

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5550640a-4736-4341-a3fe-ad3676ec33dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages