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

Ansible Plugin not working using password authentication

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: ansible-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.89.2
      Ansible-Plugin v0.8
      Redhat 7
    • Similar Issues:

      Description

      When trying to use the Ansible plugin, the SSH request is being rejected due to invalid password. However, when taking the same command and running it through "sh" Jenkins pipeline step OR directly running it in Bash, the password is accepted and the playbook execution is successful. 

      One thing to note is the password contains "$$". This is also a problem for ansible-plugin as the prependPasswordCredentials method in AbstractAnsibleInvocation.java does not quote the password. I assumed this was the only problem, fixed it and was going to submit a PR once validated, but I am still encountering issue reported when testing my modified code. 

       

      Example of running playbook through ansible plugin

      [Ansible_Test] $ sshpass -p 'P@$$word' ansible-playbook /etc/ansible/ping.yml -i /etc/ansible/environment/stg -u ansible -k -vvv
      //This fails and sshpass returns invalid password

      Example of running playbook using Jenkins "sh" step 

      [Ansible_Test] Running shell script
      + sshpass -p 'P@$$word' ansible-playbook /etc/ansible/ping.yml -i /etc/ansible/environment/stg -u ansible -k -vvv
      //This works as expected

      Username and Password have been changed but the password reflects the uniqueness of the situation. Output in Jenkins has also been unmasked for testing purposes. 

       

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              sirot Jean-Christophe Sirot
              Reporter:
              forestoden6 Forest Oden
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: