jenkins_job

Collection: community.general

Full Name: parallax.community.general.jenkins_job

Aliases: community.general.jenkins_job, jenkins_job

Synopsis

Create, update and remove Jenkins jobs

Parameters

NameTypeRequiredDefaultDescription
namestringyesName of the Jenkins job
configstringXML config for the Jenkins job
urlstringhttp://localhost:8080URL of the Jenkins server
statestringpresentState of the job Choices: present, absent, enabled, disabled
enabledbooltrueWhether the job should be enabled
userstringUser for Jenkins authentication
passwordstringPassword for Jenkins authentication
tokenstringAPI token for Jenkins authentication
validate_certsbooltrueWhether to validate SSL certificates

Example

- name: Publish a job definition to Jenkins
  jenkins_job:
    name: build-app
    config: "{{ lookup('file', 'files/build-app.xml') }}"
    url: https://jenkins.example.com
    user: automation
    token: "{{ jenkins_token }}"
    state: present