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

ansible plugin does not use "private" credentials


    • Type: Bug
    • Status: In Progress (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: ansible-plugin
    • Labels:
    • Environment:
      Jenkins 2.6.3
      ansible-plugin 0.6.2
      credentials-plugin 2.1.14

      on a linux box
    • Similar Issues:


      I'm trying to pass a "private" credentialsId (in "Stores scoped to User: my_login", as opposed to the global credentials store) to the ansible plugin with a pipeline likeĀ 

      pipeline {
          agent any
          stages {  
              stage('ssh-ansible-test') {                                                                                                                                                                                                                                                     
                  steps {                                                                                                                                                                                                                                                             
                      wrap([$class: 'MaskPasswordsBuildWrapper']) {                                                                                                                                                                                                                   
                          ansiColor('xterm') {                                                                                                                                                                                                                                        
                              timestamps {
                                          colorized: true,                                                                                                                                                                                                                            
                                          credentialsId: "MY_PRIVATE_SSH_KEY",                                                                                                                                                                                                      
                                          inventory: 'hosts',                                                                                                                                                                                                   
                                          playbook: 'test.yml'                                                                                                                                                                                                                

      but keep getting

      fatal: [my.machine.fqdn]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,password,keyboard-interactive).\r\n", "unreachable": true}

      When I do the same with a globally scoped credentialId, it works ok.

      Could it be that ansible-plugin does not have access to these credentials and if so, could this be changed please?

      I'd like to be able to make sure a logged-in-user uses his/her own private ssh key to run ansible on target machines.



          svenxy Sven Hergenhahn created issue -
          escoem Emilio Escobar made changes -
          Field Original Value New Value
          Assignee Jean-Christophe Sirot [ sirot ] Emilio Escobar [ escoem ]
          michaelcresswell Michael Cresswell made changes -
          Assignee Emilio Escobar [ escoem ] Michael Cresswell [ michaelcresswell ]
          michaelcresswell Michael Cresswell made changes -
          Status Open [ 1 ] In Progress [ 3 ]


            • Assignee:
              michaelcresswell Michael Cresswell
              svenxy Sven Hergenhahn
            • Votes:
              3 Vote for this issue
              5 Start watching this issue


              • Created: