I try to control from one unique playbook the call of the same role n times with n different vars:
---
- hosts: myhost
vars:
user: user1
virtualenv: venv_nameV3
roles:
- makeuser
- stack # use virtualenv var so stack role is installed in venv_nameV3
- stack # should need it's own virtualenv value e.g. venv_nameV4
- stack # should need it's own virtualenv value e.g. venv_nameV5
- stack # should need it's own virtualenv value e.g. venv_nameV6
You can parameterise roles by adding variables using the following syntax
---
- hosts: myhost
vars:
user: user1
virtualenv: default_venv_name
roles:
- makeuser
- { role: stack, virtualenv: 'venv_nameV3' }
- { role: stack, virtualenv: 'venv_nameV4' }
- { role: stack, virtualenv: 'venv_nameV5' }
- { role: stack, virtualenv: 'venv_nameV6' }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With