HI All,
I am newbie for both Ansible and Jenkins and I looking for step by step approach for running ansible playbook for Jenkins.
From Jenkins, I have installed Ansible plugin and in Global Tool Configuration I have set path as /usr/bin. I am trying to create free-style project by selecting project name -->in build section --> invoke ansible playbook --> location of the script /home/ansible/script.yml. However, I am unable to run it.
Initially I have added my Jenkins and ansible to be same servers but after some googling, I have installed my ansible on slave node Jenkins. Jenkins and Slaves are installed in RHEL systems. My python version is 2.5. When I run playbook its getting executed as Jenkins user.
All I need is to run Jenkins job which will run ansible playbook. I am open to any approach if it fulfils my requirement
Thanks
Vamsi
Building on master in workspace /var/lib/jenkins/workspace/Ansible_create_user [Ansible_create_user] $ sshpass ******** /usr/bin/ansible-playbook /home/ansible/create_user.yml -s -U ansible -f 5 -u ansible -k [0;35m[DEPRECATION WARNING]: DEFAULT_SUDO_USER option, In favor of Ansible Become, [0m [0;35mwhich is a generic framework. See become_user. , use become instead. This [0m [0;35mfeature will be removed in version 2.8. Deprecation warnings can be disabled by [0m [0;35m setting deprecation_warnings=False in ansible.cfg. [0m [0;31mERROR! the playbook: /home/ansible/create_user.yml could not be found [0m FATAL: command execution failed hudson.AbortException: Ansible playbook execution failed at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:262) at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:232) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1815) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) ERROR: Ansible playbook execution failed Finished: FAILURE
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/14749241-08d0-43d4-bdf5-b30ed171c0c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.