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

Ansible plugin is unable to forward ssh key

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • ansible-plugin
    • None

      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.

            sirot Jean-Christophe Sirot
            sbressey Steven Bressey
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: