'ansible-playbook: command not found' error when running from execute shell

9,325 views
Skip to first unread message

Vani Paridhyani

unread,
Sep 22, 2015, 2:08:34 AM9/22/15
to Jenkins Users
Hi!

I want to know how to run ansible-playbook from ‘execute shell’ of jenkins. I am getting 'ansible-playbook: command not found' error.
I am able to run the playbook by ssh’ng into the Jenkins box.


Victor Martinez

unread,
Sep 22, 2015, 2:27:32 AM9/22/15
to Jenkins Users
Hi,
 
  Command not found message is about your shell context, likely your ansible-playbook command is not part of the path variable, have you checked your path variables in your slave? You could either set your path or use the full path. You can see those variables if you run the below command in your shell:

env | sort

Cheers

Vani Paridhyani

unread,
Sep 22, 2015, 3:06:48 AM9/22/15
to jenkins...@googlegroups.com
Got it. Thanks Victor!

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/71Wn5NDdJIw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/bf11731c-0b03-45c7-aaf9-2e97ef282eec%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks,
Vani P.

Jagjeet Singh

unread,
Apr 1, 2020, 2:55:11 PM4/1/20
to Jenkins Users
@Vani Paridhyani - Can you help me how did you fix the issue. I am getting below error on running below command: 

Exec: ansible-playbook -i hosts simple-devops-image.yml;
Error: bash: line 1: ansible-playbook: command not found


On Tuesday, September 22, 2015 at 12:36:48 PM UTC+5:30, Vani Paridhyani wrote:
Got it. Thanks Victor!

On Tue, Sep 22, 2015 at 11:57 AM, Victor Martinez <victormar...@gmail.com> wrote:
Hi,
 
  Command not found message is about your shell context, likely your ansible-playbook command is not part of the path variable, have you checked your path variables in your slave? You could either set your path or use the full path. You can see those variables if you run the below command in your shell:

env | sort

Cheers


On Tuesday, 22 September 2015 08:08:34 UTC+2, Vani Paridhyani wrote:
Hi!

I want to know how to run ansible-playbook from ‘execute shell’ of jenkins. I am getting 'ansible-playbook: command not found' error.
I am able to run the playbook by ssh’ng into the Jenkins box.


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/71Wn5NDdJIw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkins...@googlegroups.com.



--
Thanks,
Vani P.
Reply all
Reply to author
Forward
0 new messages