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

Ansible play unable to connect remote host

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major Major
    • ansible-plugin
    • None

      My playbook unable to connect remote host with private key for cloud user.

       

      Getting following error.

      suse12sp1 #48 Console [Jenkins]
      Started by user Abhay Srivastava
      Building in workspace /var/lib/jenkins/workspace/suse12sp1
      Installer "Run Shell Command" cannot be used to install "ansible-2.4.2.0" on the node "Jenkins"
      [suse12sp1] $ /bin/ansible-playbook /tmp/test.sh -i /tmp/hosts -f 5 --private-key /tmp/ssh1894583294890662940.key -u cloud
      ERROR! playbooks must be a list of plays

      The error appears to have been in '/tmp/test.sh': line 2, column 1, but may
      be elsewhere in the file depending on the exact syntax problem.

      The offending line appears to be:

      #!/bin/bash
      /bin/ansible-playbook /tmp/test.yml -i /tmp/hosts -f 5 --private-key /tmp/KeyPair-1c48_abhay_prod.pem -u cloud
      ^ here
      FATAL: command execution failed
      hudson.AbortException: Ansible playbook execution failed
      at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:236)
      at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:207)
      at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      at hudson.model.Build$BuildExecution.build(Build.java:206)
      at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1727)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
      ERROR: Ansible playbook execution failed
      Finished: FAILURE
       

            abhaysrivastava Abhay Srivastava
            abhaysrivastava Abhay Srivastava
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: