Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/web_infrastructure/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/web_infrastructure/_jenkins_job_facts.pyo

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlZdZyddlZeZWn#ek
r�ej�ZeZnXddlmZmZdd
lmZd�Zd�Zd�Zd�Zedkre�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: jenkins_job_info
short_description: Get information about Jenkins jobs
version_added: "2.5"
description:
  - This module can be used to query information about which Jenkins jobs which already exists.
  - This module was called C(jenkins_job_info) before Ansible 2.9. The usage did not change.
requirements:
  - "python-jenkins >= 0.4.12"
options:
  name:
    description:
      - Exact name of the Jenkins job to fetch information about.
  glob:
    description:
      - A shell glob of Jenkins job names to fetch information about.
  color:
    description:
      - Only fetch jobs with the given status color.
  password:
    description:
      - Password to authenticate with the Jenkins server.
      - This is a required parameter, if C(token) is not provided.
  token:
    description:
      - API token used to authenticate with the Jenkins server.
      - This is a required parameter, if C(password) is not provided.
  url:
    description:
      - URL where the Jenkins server is accessible.
    default: http://localhost:8080
  user:
    description:
       - User to authenticate with the Jenkins server.
  validate_certs:
    description:
       - If set to C(False), the SSL certificates will not be validated.
       - This should only set to C(False) used on personally controlled sites using self-signed certificates.
    default: true
    type: bool
    version_added: "2.6"
author:
  - "Chris St. Pierre (@stpierre)"
st
# Get all Jenkins jobs using basic auth
- jenkins_job_info:
    user: admin
    password: hunter2
  register: my_jenkins_job_info

# Get all Jenkins jobs using the token
- jenkins_job_info:
    user: admin
    token: abcdefghijklmnop
  register: my_jenkins_job_info

# Get info about a single job using basic auth
- jenkins_job_info:
    name: some-job-name
    user: admin
    password: hunter2
  register: my_jenkins_job_info

# Get info about a single job in a folder using basic auth
- jenkins_job_info:
    name: some-folder-name/some-job-name
    user: admin
    password: hunter2
  register: my_jenkins_job_info

# Get info about jobs matching a shell glob using basic auth
- jenkins_job_info:
    glob: some-job-*
    user: admin
    password: hunter2
  register: my_jenkins_job_info

# Get info about all failing jobs using basic auth
- jenkins_job_info:
    color: red
    user: admin
    password: hunter2
  register: my_jenkins_job_info

# Get info about passing jobs matching a shell glob using basic auth
- jenkins_job_info:
    name: some-job-*
    color: blue
    user: admin
    password: hunter2
  register: my_jenkins_job_info

- name: Get the info from custom URL with token and validate_certs=False
  jenkins_job_info:
    user: admin
    token: 126df5c60d66c66e3b75b11104a16a8a
    url: https://jenkins.example.com
    validate_certs: False
  register: my_jenkins_job_info
s;
---
jobs:
  description: All jobs found matching the specified criteria
  returned: success
  type: list
  sample:
    [
        {
            "name": "test-job",
            "fullname": "test-folder/test-job",
            "url": "http://localhost:8080/job/test-job/",
            "color": "blue"
        },
    ]
N(t
AnsibleModuletmissing_required_lib(t	to_nativec	C`s�|jd}|jjd�}|jjd�}|jjd�}|jjd�}|rzttd�rztjt_n|r�ttd�r�|jdd�n|r�|s�|r�tj|||p�|�S|r�tj||�Stj|�SdS(	Nturltusertpasswordttokentvalidate_certst
SSLContexttmsgsyModule does not support changing verification mode with python < 2.7.9. Either update Python or use validate_certs=false.(	tparamstgetthasattrtsslt_create_unverified_contextt_create_default_https_contextt	fail_jsontjenkinstJenkins(tmoduleRtusernameR
RR((sY/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_jenkins_job_facts.pytget_jenkins_connection�s
cC`s/ts+|jdtddd�dt�ndS(NRspython-jenkinsRs<https://python-jenkins.readthedocs.io/en/latest/install.htmlt	exception(tHAS_JENKINSRR	tJENKINS_IMP_ERR(R((sY/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_jenkins_job_facts.pyttest_dependencies�s
			c`sOt��}g}�jjd�r�y|j�jjd��}Wntjk
rYqX|ji|dd6|dd6|dd6|dd6�nk|j�}�jjd�r�|j�fd�|D��n|}x$|D]}d|kr�|d=q�q�W�jjd�rKg|D](}|d�jjd�kr|^q}n|S(	NtnametfullNametfullnameRtcolortglobc3`s7|]-}tj|d�jjd��r|VqdS(R$R&N(tfnmatchRR(t.0tj(R(sY/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_jenkins_job_facts.pys	<genexpr>�st_class(	RRRtget_job_infoRtNotFoundExceptiontappendtget_all_jobstextend(Rtjenkins_conntjobstjob_infotall_jobstjobR)((RsY/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_jenkins_job_facts.pytget_jobs�s.	
8cC`sFtdtdt�dt�dt�dtdt�dtdt�dtd	d
�dt�dtd
dd	t��dddgddggdddggdt�}|jdkr�|jddd�nt|�t�}yt|�}Wn<tj	k
r+}|j
ddt|�dtj
��nX|jdtd|�dS(Nt
argument_specR"R&R%R
tno_logRRtdefaultshttp://localhost:8080RRttypetbooltmutually_exclusivetrequired_one_oftsupports_check_modetjenkins_job_factssEThe 'jenkins_job_facts' module has been renamed to 'jenkins_job_info'tversions2.13Rs'Unable to connect to Jenkins server, %sRtchangedR1(RtdicttTruet_namet	deprecateR!tlistR5RtJenkinsExceptionRR
t	tracebackt
format_exct	exit_jsontFalse(RR1terr((sY/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_jenkins_job_facts.pytmain�s2						
		t__main__(t
__future__RRRR9t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRR'RGtNoneR RRBRtImportErrorRHRJtansible.module_utils.basicRR	tansible.module_utils._textR
RR!R5RLt__name__(((sY/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_jenkins_job_facts.pyt<module>s4

/:


			&	%

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]