Permission denied while running the playbook

0 votes

I'm trying to run a playbook using this command

ansible-playbook lamp.yml

I get this:

PLAY [host1] *******************************************************************


TASK [Gathering Facts] *********************************************************

ok: [host1]


TASK [Add ppa Repository] ******************************************************

fatal: [host1]: FAILED! => {"changed": false, "module_stderr": "Shared connection to host1 closed.\r\n", "module_stdout": "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1}

 [WARNING]: Could not create retry file '/etc/ansible/lamp.retry'.

[Errno 13] Permission denied: u'/etc/ansible/lamp.retry'
Feb 9 in Ansible by Hari
171 views

1 answer to this question.

0 votes
Hey @Hari, try executing your playbook using this command:

ansible-playbook lamp.yml -K

Add a flag -K which will ask you for sudo password and then continue.
answered Feb 9 by Monish

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer

Permission denied when running ansible playbook through jenkins

Jenkins uses it's own user to execute ...READ MORE

answered Jun 25, 2018 in Ansible by DareDev
• 6,810 points
544 views
0 votes
1 answer
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
3 answers