configuration for ansible plugins

831 views
Skip to first unread message

DEBORAH AKUOKO

unread,
Sep 22, 2015, 12:37:08 PM9/22/15
to Jenkins Developers
Below is my configuration for ansible-plugin


Playbook path:   /etc/ansible/playbook.yaml

Inventory(file selected):   /etc/ansible/playbook.yaml

Credential:      username/password





after building project, i get this error;

Started by timer
Building in workspace /var/lib/jenkins/jobs/continuous-delivery-ansible/workspace
FATAL: Ansible executable not found, check your installation.
Build step 'Invoke Ansible Playbook' marked build as failure
Finished: FAILURE




path to my ansible playbook

/etc/ansible/playbook.yaml


i think the error says its building in a workspace that is different from where my playbook.yml file is. Kindly help me figure this out.


Victor Martinez

unread,
Sep 22, 2015, 12:46:39 PM9/22/15
to Jenkins Developers
Hi, 

It looks like your ansible installation is not part of the path since Ansible executable not found. Can you please verify your environment variables?


or running a shell script before launching that ansible task

env | sort
whereis ansible

I hope it heps

DEBORAH AKUOKO

unread,
Sep 22, 2015, 1:18:03 PM9/22/15
to jenkin...@googlegroups.com
Hello Victor,

Thanks for this reply, but when i run "whereis ansible" on commandline, I get this output;



ansible: /usr/bin/ansible /etc/ansible /usr/bin/X11/ansible /usr/share/ansible /usr/share/man/man1/ansible.1.gz


Also when i navigate to my last build i ma not able to locate "InjectedEnvVars"  like you showed.

please see the screenshot for the configuration. Im quite new to ansible. Thanks for your support.
You can see the location of my playbook in the terminal as well as the output of "whereis ansible"



--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/SbsEr-c1IDA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/6e682436-999b-4608-92c9-d4a80aebc400%40googlegroups.com.

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

jenkins-ansible.png

Victor Martinez

unread,
Sep 22, 2015, 3:22:02 PM9/22/15
to Jenkins Developers
I believe your command shell is misconfigured since the -i flag should point to your inventory file rather than to the binary itself. And probably you won't need to specify -i since you are using your default /etc/ansible configuration.

Have you tried those commands in your terminal?

envinject page is only available if you install that plugin, you can mimic exactly the same behaviour as long as you run 

env | sort

as part of your command shell.



Regarding the ansible build action, you might need to configure your jenkins global setup as you can see in the below url:


(see configuration section)

I Hope it helps

jcsirot

unread,
Sep 23, 2015, 4:27:35 AM9/23/15
to Jenkins Developers
Hello

You need to indicate to Jenkins where the ansible binary is located. Go to the Jenkins configuration and look for the ansible installation section. You need to create at least one installation. The name field must contain a symbolic name to identify this ansible installation and the "Path to ansible executables directory" field must contain the directory where are located the ansible and ansible-playbook binaries; in your case probably /usr/bin).
Reply all
Reply to author
Forward
0 new messages