Ansible 2.7.8, role dependencies(github repo) in meta/main.yml are not downloaded automatically, why? still have to run ansible-galaxy install -r requirements.yml?

17 views
Skip to first unread message

rell...@gmail.com

unread,
Mar 13, 2019, 2:11:27 AM3/13/19
to Ansible Project
Ansible verison: 2.7.8

I define role B as Role A dependencies in meta/main.yml like this:
```
dependencies:
  - { role: B, src: 'git+https://github.xxx/xxx/B.git', version: '1.0' }

```

When I run playbook with Role A, I suppose ansible would download Role B automatically. But not. Why?
Shall I run ansible-galaxy install -r requirements.yml firstly?

Thank you.

Dick Visser

unread,
Mar 13, 2019, 3:04:11 PM3/13/19
to ansible...@googlegroups.com
Yes.

When a role is installed, any dependencies are automatically installed
as well (from https://galaxy.ansible.com/docs/using/installing.html#dependencies).
Running playbooks (i.e. deploying infrastructure) does not magically
pull in remote content.

So with ansible-galaxy you make sure all the roles etc are in place.
And then you playbooks can use them.


Dick

--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT
Reply all
Reply to author
Forward
0 new messages