Ansible, role not found error

Question:

I try to play following playbook against localhost to provision Vagrant machine

I have cloned necessary roles from github and they resides in a relative path roles/{role name}

Executing following command: ansible-playbook -i "localhost," -c local playbook.yml outputs this error:

I cloned the missing dependency from github, and tried to reside it in relative path of roles/java and roles/geerlingguy/java, but either didn’t solve the problem, and error stays the same.

I want to keep all roles locally in the synced provisioning folder, without using ansible-galaxy runtime, to make the provisioning method as self contained as possible.

Here is the provision folder structure as it is now

Answer:

You should install or clone all required roles in the /roles folder (or in the system folder)

should fix this specific problem.

However, the best practice should be the use of a requirements.yml file where you require all the needed roles and then install them with ansible-galaxy directly in your playbook.

Leave a Reply