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

Ansible Playbook Fails when Executed Through Jenkins passing extraVars

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • ansible-plugin
    • None
    • Jenkins 2.387.3
      CentOS Linux 7 (Core)
      ansible 2.9.27
      Ansible plugin Version 205.v4cb_c48657c21
    • 215.v1c78933a_b_0d7

      With declarative pipeline

      ansiblePlaybook([ 
                   become: false, 
                   colorized: true, 
                   installation: 'ansible', 
                   extraVars: [
                      login: 'mylogin',
                      secret_key: [value: 'g4dfKWENpeF6pY05', hidden: true]
                    ],                       
                       playbook: 'src/main/ansible/prova_parametri.yml'
                  ])

      Error:
      Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 14664390-9354-402a-9ae2-cdc3c89cdb1f
      java.lang.ClassCastException: class java.lang.String cannot be cast to class hudson.util.Secret (java.lang.String is in module java.base of loader 'bootstrap'; hudson.util.Secret is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @76908cc0)
      at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.convertExtraVars(AnsiblePlaybookStep.java:390)
      at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:422)
      at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:352)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      at hudson.security.ACL.impersonate2(ACL.java:451)
      at hudson.security.ACL.impersonate(ACL.java:463)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:829)
       

       

       

            jonesbusy Valentin Delaye
            c73680 CARLO VERDECCHIA
            Votes:
            7 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: