Permission denied when running ansible playbook through jenkins

0 votes

I'm unable to run ansible playbook via jenkins. The logs say permission denied but if run the same from putty directly it exdecutes successfully.

Jun 25, 2018 in Ansible by shubham
• 6,890 points
790 views

1 answer to this question.

0 votes
Jenkins uses it's own user to execute its commands on its hosts i.e. jenkins uses jenkins user to execute any command. For while connecting with remote on your ansible, you used your default/current host as ssh host and not jenkins.

To run ansible commands via jenkins you need to SSH into host using jenkins user.
answered Jun 25, 2018 by DareDev
• 6,810 points

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer

Permission denied while running the playbook

Hey @Hari, try executing your playbook using ...READ MORE

answered Feb 9 in Ansible by Monish
636 views
0 votes
1 answer
0 votes
1 answer

Running a playbook using Ansible on Jenkins

Hey, @Asha seems like you've added a ...READ MORE

answered Apr 4 in Ansible by Akhil
727 views
0 votes
1 answer

Not able to connect remote host via jenkins to run ansible playbook

set "host_key_checking = False" in /etc/ansible/ansible.cfg READ MORE

answered Dec 2 in Jenkins by pavan

reshown Dec 2 by Vardhan 1,695 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
254 views
0 votes
1 answer

Running ansible command on a single server when it is deployed to multiple servers

You can try the run_once attribute: Example from ...READ MORE

answered Jun 13, 2018 in Ansible by DareDev
• 6,810 points
237 views
0 votes
1 answer

ansible playbook: using multiple variables in loops

Use an indexed hostname, and then define ...READ MORE

answered Jul 16, 2018 in Ansible by DareDev
• 6,810 points
5,617 views