ERROR the role root web was not found in root roles root ansible roles usr share ansible roles etc ansible roles root

0 votes

Hi Guys,

I have created one playbook in Ansible. Now I am trying to run this playbook. But it is showing me the below error.

$ ansible-playbook web.yml
ERROR! the role '/root/web' was not found in /root/roles:/root/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/root
The error appears to be in '/root/web.yml': line 3, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
  roles:
    - /root/web
      ^ here
Aug 20, 2020 in Ansible by akhtar
• 38,210 points
520 views

1 answer to this question.

0 votes

Hi@akhtar,

You are trying to use ansible role in your playbook. But you did not set the path for the role. So set the path in your ansible.cfg file as shown below.

$ vim /etc/ansible/ansible.cfg
[defaults]
inventory = /etc/myhosts.txt
host_key_checking = False
roles_path= /etc/myroles
answered Aug 20, 2020 by MD
• 95,300 points

Related Questions In Ansible

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,289 views
+2 votes
1 answer
0 votes
1 answer