Problem:
I have a playbook that import another playbook for a task. When I import this playbook, the inventory variables I’ve set don’t get applied to the imported playbook.
Setup:
I have a playbook that imports a number of plays like so:
Create the pod
- import_playbook: …/library/create_pod.yml
#Wait for boot volumes to populate
- import_playbook: k8s_waitforbootlun.yml
#Reboot the server to pick up the new boot volume
- import_playbook: …/redfish/systems/power_reboot.yml
For any playbook where I refer to another directory outside of the root playbook, the inventory variables I’ve set do not carry over to the playbook.
For example, " - import_playbook: k8s_waitforbootlun.yml" applies inventory variables I’ve assigned, but " - import_playbook: …/redfish/systems/power_reboot.yml" does not.
Workaround:
I can make this work by setting the variables I need in the template, but this requires me to know and set variables for each template according to what it calls. I’d rather be able to define all the variables all called playbooks would require in the inventory itself.
Forgive my ignorance if I’m missing something.
Thanks in advance.