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

ansible plugin doesn't work with general build step of pipeline in 0.62 version

    XMLWordPrintable

Details

    Description

      ansible plugin doesn't work with general build step of pipeline  in 0.62 version

      node {
          step([$class: 'AnsiblePlaybookBuilder',
              additionalParameters: '-e port=8081',
              ansibleName: 'ansible',
              credentialsId: '',
              inventory: [$class: 'InventoryContent',
              content: '''[tomcat]
      192.168.10.10''',
              dynamic: false],
              limit: '',
              playbook: '/opt/ansible/tomcat.yml',
              skippedTags: '',
              startAtTask: '',
              sudoUser: '',
              tags: ''])
      }

      This codes return error

      ERROR: The ansible playbook build step requires to be launched on a node

       

      node {
          ansiblePlaybook(
              colorized: true,
              extras: '-e port=8081',
              installation: 'ansible',
              inventory: '/opt/ansible/hosts',
              playbook: '/opt/ansible/tomcat.yml',
              sudoUser: null)
      }

      This codes work fine

       

      Attachments

        Issue Links

          Activity

            michaelcresswell Michael Cresswell added a comment - Fixed in  https://github.com/jenkinsci/ansible-plugin/pull/21

            Code changed in jenkins
            User: michaelcresswell
            Path:
            src/main/java/org/jenkinsci/plugins/ansible/AnsibleAdHocCommandBuilder.java
            src/main/java/org/jenkinsci/plugins/ansible/AnsiblePlaybookBuilder.java
            src/main/java/org/jenkinsci/plugins/ansible/AnsibleVaultBuilder.java
            http://jenkins-ci.org/commit/ansible-plugin/02694ea4c4f08d1ace78afd5116ad76db8ddb458
            Log:
            [FIXED JENKINS-43782] General Build Steps Do Not Work In Pipelines (#21)

            Get Computer object off the workspace instead of static Computer method.

            Source: https://groups.google.com/forum/#!topic/jenkinsci-dev/MwdVHQ-lbvc
            "You can get the `Node`/`Computer` from the `FilePath workspace` (which will work for freestyle builds, too)"

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: michaelcresswell Path: src/main/java/org/jenkinsci/plugins/ansible/AnsibleAdHocCommandBuilder.java src/main/java/org/jenkinsci/plugins/ansible/AnsiblePlaybookBuilder.java src/main/java/org/jenkinsci/plugins/ansible/AnsibleVaultBuilder.java http://jenkins-ci.org/commit/ansible-plugin/02694ea4c4f08d1ace78afd5116ad76db8ddb458 Log: [FIXED JENKINS-43782] General Build Steps Do Not Work In Pipelines (#21) Get Computer object off the workspace instead of static Computer method. Source: https://groups.google.com/forum/#!topic/jenkinsci-dev/MwdVHQ-lbvc "You can get the `Node`/`Computer` from the `FilePath workspace` (which will work for freestyle builds, too)"

            People

              escoem Emilio Escobar
              xpflying xu peng
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: