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

sshpass ignored in jenkins job?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: ansible-plugin
    • Labels:
      None
    • Environment:
      jenkins 2.53
      Ansible plugin 0.6.2
      Ansible 1.5.4
    • Similar Issues:

      Description

      I have jenkins with ansible plugin and ansible all on the same machine.

      I have a playbook, the key line being

      local_action: command sshpass -f /home/user/passwordfile ssh user@mint-gitlab-vm ls

      Just to add this is just testing things and I used sshpass as I just wanted to try something, in reality I would use ssh keys. So much for quick ....

      Anyway, when I run this playbook from the command line, it works, it prints out the listing.

      But when I run it within a jenkins job, I get the following error

      stderr: Host key verification failed.

      Which suggests it is ignoring sshpass and looking for keys.

      So, I simply run local_action: command sshpass -V

      and that worked as expected, showing the version info. So sshpass is not ignored. But neither is the password being accepted by ssh.

      Any ideas? Or is this a bug?

      Regards,

        Attachments

          Activity

          norricorp John Norris created issue -
          norricorp John Norris made changes -
          Field Original Value New Value
          Component/s ansible-plugin [ 20624 ]
          Component/s _unsorted [ 19622 ]
          norricorp John Norris made changes -
          Assignee Oleg Nenashev [ oleg_nenashev ] Jean-Christophe Sirot [ sirot ]
          norricorp John Norris made changes -
          Description I have jenkins with ansible plugin and ansible all on the same machine.

          I have a playbook, the key line being

          sshpass -f /home/user/passwordfile ssh user@mint-gitlab-vm ls

          Just to add this is just testing things and I used sshpass as I just wanted to try something, in reality I would use ssh keys. So much for quick ....

          Anyway, when I run this playbook it works, it prints out the listing.

          But when I run it within a jenkins job, I get the following error

          stderr: Host key verification failed.

          Which suggests it is ignoring sshpass and looking for keys.

          Any ideas? Or is this a bug?

          Regards,
          I have jenkins with ansible plugin and ansible all on the same machine.

          I have a playbook, the key line being

          local_action: command sshpass -f /home/user/passwordfile ssh user@mint-gitlab-vm ls

          Just to add this is just testing things and I used sshpass as I just wanted to try something, in reality I would use ssh keys. So much for quick ....

          Anyway, when I run this playbook from the command line, it works, it prints out the listing.

          But when I run it within a jenkins job, I get the following error

          stderr: Host key verification failed.

          Which suggests it is ignoring sshpass and looking for keys.

          Any ideas? Or is this a bug?

          Regards,
          norricorp John Norris made changes -
          Description I have jenkins with ansible plugin and ansible all on the same machine.

          I have a playbook, the key line being

          local_action: command sshpass -f /home/user/passwordfile ssh user@mint-gitlab-vm ls

          Just to add this is just testing things and I used sshpass as I just wanted to try something, in reality I would use ssh keys. So much for quick ....

          Anyway, when I run this playbook from the command line, it works, it prints out the listing.

          But when I run it within a jenkins job, I get the following error

          stderr: Host key verification failed.

          Which suggests it is ignoring sshpass and looking for keys.

          Any ideas? Or is this a bug?

          Regards,
          I have jenkins with ansible plugin and ansible all on the same machine.

          I have a playbook, the key line being

          local_action: command sshpass -f /home/user/passwordfile ssh user@mint-gitlab-vm ls

          Just to add this is just testing things and I used sshpass as I just wanted to try something, in reality I would use ssh keys. So much for quick ....

          Anyway, when I run this playbook from the command line, it works, it prints out the listing.

          But when I run it within a jenkins job, I get the following error

          stderr: Host key verification failed.

          Which suggests it is ignoring sshpass and looking for keys.

          So, I simply run local_action: command sshpass -V

          and that worked as expected, showing the version info. So sshpass is not ignored. But neither is the password being accepted by ssh.

          Any ideas? Or is this a bug?

          Regards,
          Hide
          norricorp John Norris added a comment -

          I found the problem. Jenkins is runnning as jenkins user and that user had not ssh'd before so it was the host key that needed yes/no, not the rsa key.

          Show
          norricorp John Norris added a comment - I found the problem. Jenkins is runnning as jenkins user and that user had not ssh'd before so it was the host key that needed yes/no, not the rsa key.
          Hide
          norricorp John Norris added a comment -

          Added comment. Problem was that jenkins user had to add known hosts.

          Show
          norricorp John Norris added a comment - Added comment. Problem was that jenkins user had to add known hosts.
          norricorp John Norris made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]

            People

            Assignee:
            sirot Jean-Christophe Sirot
            Reporter:
            norricorp John Norris
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: