Question
Kindly explain why a directory path cannot be specified directory in the list item of roles.
- name: Test
hosts: local
become: true
roles:
- ubuntu/16/site.nginx
# - { role: 'site.nginx', dir: 'ubuntu/16' } <---- ERROR
# - { role: 'ubuntu/16/site.nginx' } <--- OK
Error
ERROR! the role 'centos/16/site.nginx' was not found in ...
The offending line appears to be:
roles:
- ubuntu/16/site.nginx
^ here
Directory Structure
roles
└── ubuntu
└── 16
├── site.ngnix
OK playbook
- name: Test
hosts: local
become: true
roles:
- { role: 'ubuntu/16/site.nginx' }
Result
....
PLAY RECAP *********************************************************************
localhost : ok=15 changed=2 unreachable=0 failed=0