With the setup you describe, you have basically two jenkins-aware options.
One, which is closer to what you are currently making, is to give ssh
permission from jenkins to ansible servers. In that case you will need also
one of the plugins that allows Jenkins to execute ssh commands in a
different node (ssh-plugin or similar one) and use it instead of standard
shell command box, _but_ the remote node has no access to whatever lives at
the jenkins server, and will only access whatever exists at the ansible
server unless you explicitly copy it (it's just ssh after all). The second
approach which is the one that will probably behave as you expect, is to
make the ansible server a Jenkins slave, and configure all ansible jobs to
be executed in that slave with standard shell command box, you can drop the
ssh stuff and run the slave as a user capable to run ansible, but security
implications are not actually higher than giving ssh access (except maybe
firewall ports). In this setup the workspace lives at the ansible (slave)
server, but it is transparent to you because everything else is stored at
jenkins (master) server.

On Wed, Feb 3, 2016 at 2:46 AM, Kiran <[email protected]> wrote:

> My Ansible (version 1.9.5) server is on its own dedicated CentOS 7
> server.  My Jenkins (version 1.6) server is on its own dedicated CentOS 7
> server.  I installed the Ansible plugin for Jenkins.  I created a New Item
> that invokes an ad-hoc Ansible command.  For the Ansible Installation
> field, I enter the DNS name of the Ansible server.  For host pattern, I
> chose the group of servers that I want the Ansible playbook to run again.
> The group name was defined in the .../ansible/hosts file.
>
> The console output of this new Jenkins job that should invoke an ansible
> command (on a separate server with Ansible installed) says this:
>
> "Building in workspace /var/lib/jenkins/jobs/... $ sshpass ****** /ansible
> ... DNSnameOfAnsibleServer -i ... FATAL: command execution failed
> hudson.AbortException: Ansible Ad-Hoc command execution failed at
> org.jenkinsci.plugins.ansible.AnsibleAdHocCommandBuilder.perform(AnsibleAdHocCommandBuilder.java:176
> at ..."
>
> Does the Ansible server need sshpass? The Jenkins server has sshpass.
>
> How do I get Jenkins to invoke an ansible playbook on an Ansible server?
> This error makes me think that something is wrong with sshpass.  I can view
> the man page of sshpass.  Is there a certain version that I need?
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/32c8703f-1d00-401e-8b67-0c8e97aac28d%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/32c8703f-1d00-401e-8b67-0c8e97aac28d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CANsNpURu%2BsqEsGqdME8sqx9Z1vBM1PfZz6j2Dq9XdAC%2Bn7Hn-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to