I am trying to use Ansible's dependencies feature but I cannot get it to work. Could someone provide a minimal example of a role that depends on another role that uses the dependencies feature eg:
---
dependencies:
- { role: common }
Many thanks.
You should be able to use it if you put the content you specified in your question in this file:
<your-project-home>/roles/webservers/meta/main.yml
Make sure your common
role exists in:
<your-project-home>/roles/common
Make sure your project structure looks like this:
yourplaybook.yml
roles/
common/
webservers/
yourplaybook.yml
should look something like this:
---
- hosts: all
roles:
- webservers
Then you would call your playbook like this:
ansible-playbook -i ./inventory-file yourplaybook.yml
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