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,870 points
550 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
173 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
148 views
0 votes
0 answers

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

Not able to connect remote host via ...READ MORE

Apr 2 in Jenkins by Nishant
• 160 points

recategorized Apr 2 by Nishant 550 views
+13 votes
2 answers
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
124 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
3,580 views