getting error while trying to create my own role

55 views
Skip to first unread message

acharya tejaswi indurthi

unread,
Apr 25, 2017, 5:49:28 AM4/25/17
to Ansible Project
Hi,

I am trying to create a new role from my playbook. I had created a file with the created role

---
- hosts: localhost
  connection: local
  gather_facts: yes
  roles:
   - own_test

when i am trying with ansible-playbook own_role.yml getting an error

PLAY [localhost] ***************************************************************

TASK [setup] *******************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/bin/lsb_release -a", "failed": true, "msg": "[Errno 2] No such file or directory", "rc": 2}
to retry, use: --limit @/etc/ansible/playbooks/own_role.retry

PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1   

where is the mistake.Can anyone help me

Thanks,

nabila.ari...@gmail.com

unread,
Apr 25, 2017, 12:13:18 PM4/25/17
to Ansible Project


your file role must be in the path ansible/roles/own_test/tasks/main.yml

Dick Davies

unread,
Apr 25, 2017, 1:04:12 PM4/25/17
to ansible list
It is, or the task wouldn't have run.

OP: Your role looks broken, but you haven't show that.

Probably /usr/bin/lsb_release doesn't exist on localhost.
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/47c87c16-618e-43f9-8ee2-b5288ffcd49c%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

acharya tejaswi indurthi

unread,
Apr 28, 2017, 4:23:20 AM4/28/17
to Ansible Project
I resolved that by adding become_method: sudo
  remote_user: ec2_user in that above own_test.yml


Thanks,

Reply all
Reply to author
Forward
0 new messages