#Playbook Structure mindset

1 messages · Page 1 of 1 (latest)

flint yacht
#

Hi folks,

Is it logically better to have one big arse playbook that does everything I need for a respective task? Or numerous smaller playbooks for each task?

In this example, I have an existing 1100 line playbook that handles vol creation, snapmirror, mounting vols, creating ad groups, applying perms, dfs management, etc.
Literally everything for this one task.

We also have PagerDuty's Rundeck in place to be able to string playbooks together via Jobs.

Is it best to keep them together in one? Or break it up by sections?

#

If I don't use Rundeck, it appears I can
Include: <playbook> and have one "worker" playbook, but I don't suppose that's recommended either.

ashen gulch
#

Roles and Includes are best to help organize and for reuse in other plays.

flint yacht
#

How difficult is it to pass variables from the top level playbook to the included one? Using it like a function then almost?

ashen gulch
#

very easy, variables scoped in the Playbook automatically pass to the included tasks. For roles, all the files in the vars directory are parsed and variables included. Put all the static variables in the include or vars dir. Put all the array / site specific info in the playbook