Closed lakshmantgld closed 9 years ago
Your path does look a bit weird. /Users/lakshman/ansible-try1/roles/role/roles/ANXS.hostname
It looks there is a role/roles
too much
now i have rectified the clumsy path. now where should i place this role named "nginx". Either in /opt/ansible/roles or create a path in ansible.cfg and place it there.
btw what is this ANXS.hostname should i change any file in the role
If your role path is /opt/ansible/roles
then the role should be placed in /opt/ansible/roles/ANXS.nginx
SO THE ROLE PATH IS SAME AS WHAT YOU SAID, should i change the role name to "ANXS.nginx".
i still can't understand how it takes the role. please add execution of role in readme page
If you say your role path is the same as I wrote then your current setup is not correct.
As you can read on the screenshot you posted the role needs to be placed in /Users/lakshman/ansible-try1/roles/nginx
or /opt/local/etc/ansible/roles/nginx
and not /opt/ansible/roles/ANXS.nginx
To be clear: 1) I have placed my roles in the default configuration . i.e /opt/local/etc/ansible/roles/ . so the role named nginx is placed here.
2) If i place it under ANXS.nginx, it also gives me an error
I am quite confused, please help me with this
can you post the out put of ls -la /opt/local/etc/ansible
and ls -la /opt/local/etc/ansible/roles
?
Rename the folder to nginx
As you can see if the outputs before it's looking for nginx and not ANXS.nginx
so this is like i have created nginx dir , inside that an nginx within that all tasks, handlers,etc,.
now it gives an error like this.
if i make just roles/nginx and this nginx contains all tasks, handlers. This gives me an error asking ANXS.nginx
I have worked on roles, but this gives me weird error
It's complaining that specific files can't be found. Are they present at all?
ya they are present
If the files are in place I don't know...
maybe try creating an empty dir from scratch. Create the playbook which includes the role in that empty dir.
Then install put all required roles in a roles
subdir and try executing the playbook again.
I'm not totally sure what's wrong with your paths
ya ok thank you
ERROR: cannot find role in /Users/lakshman/ansible-try1/roles/role/roles/ANXS.hostname i have the downloaded role and i am running with ansible playbook command as following
and i have also set the roles-path as : roles_path = /Users/lakshman/ansible-try1/roles in ansible.cfg