ktdreyer/jenkins-job-wrecker

Not able to parse ansible playbook data in builder

Opened this issue · 1 comments

I have job config as

<?xml version='1.0' encoding='UTF-8'?>
<project>
  <actions/>
  <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
  <keepDependencies>false</keepDependencies>
  <properties/>
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.7.0">
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <name>origin</name>
        <refspec>+refs/heads/*:refs/remotes/origin/*</refspec>
        <url>https://github.com/test.git</url>
        <credentialsId>github_username_with_token</credentialsId>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>*/master</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions>
      <hudson.plugins.git.extensions.impl.WipeWorkspace/>
    </extensions>
  </scm>
  <assignedNode>linux</assignedNode>
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder plugin="ansible@0.8">
      <playbook>ldap_setup.yaml</playbook>
      <inventory class="org.jenkinsci.plugins.ansible.InventoryPath">
        <path>hosts</path>
      </inventory>
      <limit>localhost</limit>
      <tags></tags>
      <skippedTags></skippedTags>
      <startAtTask></startAtTask>
      <credentialsId></credentialsId>
      <vaultCredentialsId></vaultCredentialsId>
      <sudo>false</sudo>
      <sudoUser></sudoUser>
      <forks>5</forks>
      <unbufferedOutput>true</unbufferedOutput>
      <colorizedOutput>false</colorizedOutput>
      <hostKeyChecking>false</hostKeyChecking>
      <additionalParameters>-b --become-method su --become-user root -u myuser</additionalParameters>
      <copyCredentialsInWorkspace>false</copyCredentialsInWorkspace>
      <extraVars>
        <org.jenkinsci.plugins.ansible.ExtraVar>
          <key>ldap_password</key>
          <value>********</value>
          <hidden>true</hidden>
        </org.jenkinsci.plugins.ansible.ExtraVar>
        <org.jenkinsci.plugins.ansible.ExtraVar>
          <key>parameter2</key>
          <value>********</value>
          <hidden>true</hidden>
        </org.jenkinsci.plugins.ansible.ExtraVar>
      </extraVars>
    </org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder>
  </builders>
  <publishers/>
  <buildWrappers>
    <hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.5.2">
      <colorMapName>xterm</colorMapName>
    </hudson.plugins.ansicolor.AnsiColorBuildWrapper>
  </buildWrappers>
</project>

When I tried to convert this to yaml, it not parse the AnsiblePlabookBuilder.

- job:
    block-downstream: false
    block-upstream: false
    builders:
    - raw:
        xml: |
          <org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder plugin="ansible@0.8">
          <playbook>ldap_setup.yaml</playbook>
          <inventory class="org.jenkinsci.plugins.ansible.InventoryPath">
          <path>hosts</path>
          </inventory>
          <limit>localhost</limit>
          <tags />
          <skippedTags />
          <startAtTask />
          <credentialsId />
          <vaultCredentialsId />
          <sudo>false</sudo>
          <sudoUser />
          <forks>5</forks>
          <unbufferedOutput>true</unbufferedOutput>
          <colorizedOutput>false</colorizedOutput>
          <hostKeyChecking>false</hostKeyChecking>
          <additionalParameters>-b --become-method su --become-user root -u myuser</additionalParameters>
          <copyCredentialsInWorkspace>false</copyCredentialsInWorkspace>
          <extraVars>
          <org.jenkinsci.plugins.ansible.ExtraVar>
          <key>ldap_password</key>
          <value>********</value>
          <hidden>true</hidden>
          </org.jenkinsci.plugins.ansible.ExtraVar>
          <org.jenkinsci.plugins.ansible.ExtraVar>
          <key>parameter2</key>
          <value>********</value>
          <hidden>true</hidden>
          </org.jenkinsci.plugins.ansible.ExtraVar>
          </extraVars>
          </org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder>
    concurrent: false
    description: <!-- Managed by Jenkins Job Builder -->
    disabled: false
    name: !!python/unicode '/tmp/test.yaml'
    node: linux
    project-type: freestyle
    publishers: []
    scm:
    - git:
        branches:
        - '*/master'
        credentials-id: github_username_with_token
        name: origin
        refspec: +refs/heads/*:refs/remotes/origin/*
        url: https://github.com/test.git
        wipe-workspace: true
    triggers: []
    wrappers:
    - ansicolor:
        colormap: xterm

You're right, we need to add support for AnsiblePlaybookBuilder