Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37548

Ansible plugin is unable to forward ssh key

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I have setup a job with a build step that triggers an ansible playbook.
      This playbook will connect to a remote host and do a git pull on a github repository.
      The ansible inventory is configured with an ssh key that can access the github repository, but unfortunately, the ssh key used by the playbook is not forwarded.
      I confirm that , if I execute the ansible playbook manually on the Jenkins server, the key is forwarded.
      I tried adding
      ANSIBLE_SSH_ARGS="-o ForwardAgent=yes"
      ANSIBLE_TRANSPORT="ssh"
      environment variables in Global Tool configuration, but it is still not working.

      The error returned by the ansible playbook in the console output is :
      Permission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists."

      Any help would be appreciated.

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              sirot Jean-Christophe Sirot
              Reporter:
              sbressey Steven Bressey
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: