Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to parse ansible playbook data in builder #68

Open
lafada opened this issue Feb 9, 2018 · 1 comment
Open

Not able to parse ansible playbook data in builder #68

lafada opened this issue Feb 9, 2018 · 1 comment

Comments

@lafada
Copy link

lafada commented Feb 9, 2018

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="[email protected]">
    <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="[email protected]">
      <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="[email protected]">
      <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="[email protected]">
          <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
@ktdreyer
Copy link
Owner

ktdreyer commented Apr 9, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants