Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've got this bit in my playbook.

 roles:
  - {role: cleanup-create, dir: '/standard/', commit: "{{choice}}"}

The file structure is /roles/standard/cleanup-create/tasks/main.yml

And yet I receive this error:

ERROR! the role 'cleanup-create' was not found in /home/myuser/network-ansible-myuser/roles:/home/myuser/network-ansible-myuser:/etc/ansible/roles

The error appears to have been in '/home/myuser/network-ansible-myuser/configure-files.yml': line 15, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  roles:
  - {role: cleanup-create, dir: '/standard', commit: "{{choice}}"}
    ^ here

Now, the error message seems to be saying my role wasn't found in /roles. However the dir parameter should make it look under /roles/standard.

It was working 5 minutes ago, I swear!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
157 views
Welcome To Ask or Share your Answers For Others

1 Answer

There is no dir special parameter for roles.
It is just an ordinary variable, same as commit in your example.

You should place all your roles directly in ./roles folder without any nesting.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...