I have a python script that creates a jenkins job, as below
def create_jenkins_job(self):
jenk = jenkins.Jenkins(jenkins_url, username=jenkins_user, password=jenkins_token)
jobs = jenk.create_job('test2', jenkins.EMPTY_CONFIG_XML)
return True
This successfully creates an empty job as expected. I'm trying to have this job run an Ansible playbook, held locally in the same directory. The ansible plugin is already installed on the jenkins instance. Is it possible to create a job with the ansible parameter and pass the playbook to it?