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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | yes | Name of the Jenkins job | |
| config | string | XML config for the Jenkins job | ||
| url | string | http://localhost:8080 | URL of the Jenkins server | |
| state | string | present | State of the job Choices: present, absent, enabled, disabled | |
| enabled | bool | true | Whether the job should be enabled | |
| user | string | User for Jenkins authentication | ||
| password | string | Password for Jenkins authentication | ||
| token | string | API token for Jenkins authentication | ||
| validate_certs | bool | true | Whether 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