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

Seed job that uses Job DSL to create new jobs, causes all jobs that use ansible plugin to be in a error state (Java.IO.Exception cannot run Ansible-Playbook)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • Jenkins 2.289.2, Ansible Plugin 1.1, Job DSL 1.7, JCasC plugin 1.51, Uses jenkins configuration file to setup server, Ansible version 2.11.2, (also tried newest jenkins 2.3)

      We have been setting up a Jenkins development server and have been running into automation issues. Our current workflow is that we create a "Seed" job, which is a regular freestyle job in the UI, that serves to create all the rest of our jobs using the job DSL plugin. Therefore, this allows us to recreate our production server given that all our jobs from our production server are converted to groovy files. Once the seed job runs, it creates a bunch of new jobs which mimics our production server without having to create each job on its own. However, we are running into a problem when it comes to jobs that use the ansible plugin (which is the majority of the jobs). Upon trying to run these jobs we end up with the error: java.io.IOException: Cannot run program "ansible-playbook" as shown in the following photo. Through testing we managed to discover that upon opening the configuration of the job and making a change (i.e. checking and unchecking a boolean value or deleting a letter than re-adding a letter in textboxes) the job manages to execute successfully.  Once this state is fixed, then the issue does not come back. Our plan is to continuously run the seed job when we make changes to our groovy scripts, so our jobs can be updated without much work. However, every time we rerun the seed job we have this same error on the first run of each job until we use the solution as described above. (Note: we use a configuration file through the JCasC plugin so I was theorizing that this could create issues but potentially just a hunch)

            sirot Jean-Christophe Sirot
            mturek Max
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: