I'm trying to find out how I can pass Ansible playbook variables defined in a 'master' playbook into other playbooks that I've already referenced in my master playbook.
For example, with the below 'master' playbook, I'd like to pass the values of sethostname and setipaddress to playbook[1-3].yml referenced in my tasks section. This would be akin to calling functions in other programming languages.
---
- hosts: all
become: yes
vars_prompt:
- name: "sethostname"
prompt: "What will be the machine's hostname?"
private: no
- name: "setipaddress"
prompt: "What will be the machine's IP address?"
private: no
tasks:
- include: playbook1.yml
- include: playbook2.yml
- include: playbook3.yml