community.general.jenkins_build_info module – Get information about Jenkins builds
Note
This module is part of the community.general collection (version 10.0.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.jenkins_build_info
.
New in community.general 7.4.0
Synopsis
Get information about Jenkins builds with Jenkins REST API.
Requirements
The below requirements are needed on the host that executes this module.
python-jenkins >= 0.4.12
Parameters
Parameter |
Comments |
---|---|
An integer which specifies a build of a job. If not specified the last build information will be returned. |
|
Name of the Jenkins job to which the build belongs. |
|
Password to authenticate with the Jenkins server. |
|
API token used to authenticate with the Jenkins server. |
|
URL of the Jenkins server. Default: |
|
User to authenticate with the Jenkins server. |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Get information about a jenkins build using basic authentication
community.general.jenkins_build_info:
name: "test-check"
build_number: 1
user: admin
password: asdfg
url: http://localhost:8080
- name: Get information about a jenkins build anonymously
community.general.jenkins_build_info:
name: "stop-check"
build_number: 3
url: http://localhost:8080
- name: Get information about a jenkins build using token authentication
community.general.jenkins_build_info:
name: "delete-experiment"
build_number: 30
user: Jenkins
token: abcdefghijklmnopqrstuvwxyz123456
url: http://localhost:8080
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Build info of the jenkins job. Returned: success |
|
Name of the jenkins job. Returned: success Sample: |
|
State of the jenkins job. Returned: success Sample: |
|
URL to connect to the Jenkins server. Returned: success Sample: |
|
User used for authentication. Returned: success Sample: |