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/rundeck_project.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZddlZdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys3
---
module: rundeck_project

short_description: Manage Rundeck projects.
description:
    - Create and remove Rundeck projects through HTTP API.
version_added: "2.4"
author: "Loic Blot (@nerzhul)"
options:
    state:
        description:
            - Create or remove Rundeck project.
        choices: ['present', 'absent']
        default: 'present'
    name:
        description:
            - Sets the project name.
        required: True
    url:
        description:
            - Sets the rundeck instance URL.
        required: True
    api_version:
        description:
            - Sets the API version used by module.
            - API version must be at least 14.
        default: 14
    token:
        description:
            - Sets the token to authenticate against Rundeck API.
        required: True
sI
- name: Create a rundeck project
  rundeck_project:
    name: "Project_01"
    api_version: 18
    url: "https://rundeck.example.org"
    token: "mytoken"
    state: present

- name: Remove a rundeck project
  rundeck_project:
    name: "Project_02"
    url: "https://rundeck.example.org"
    token: "mytoken"
    state: absent
sd
rundeck_response:
    description: Rundeck response when a failure occurs
    returned: failed
    type: str
before:
    description: dictionary containing project information before modification
    returned: success
    type: dict
after:
    description: dictionary containing project information after modification
    returned: success
    type: dict
(t
AnsibleModule(t	to_native(t	fetch_urlNtRundeckProjectManagercB`sDeZd�Zd�Zddd�Zd�Zd�Zd�ZRS(cC`s
||_dS(N(tmodule(tselfR((sV/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/rundeck_project.pyt__init__]scC`sd|ddkr0|jjddd|d�n0|ddkr`|jjddd|d�ndS(	NRi�tmsgsQToken not allowed. Please ensure token is allowed or has the correct permissions.trundeck_responsetbodyi�sFatal Rundeck API error.(Rt	fail_json(R
tinfos((sV/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/rundeck_project.pythandle_http_code_if_needed`s
tGETcC`s
t|jd|jjd|jjd|fdtj|�d|didd6dd	6|jjd
d6�\}}|j|�|dk	r|j�}|dkrytj|�}||fSWq�t	k
r�}|jj
d
dt|�|f�q�Xqn||fS(Ns%s/api/%d/%sturltapi_versiontdatatmethodtheaderssapplication/jsonsContent-TypetAcceptttokensX-Rundeck-Auth-TokentRsHRundeck response was not a valid JSON. Exception was: %s. Object was: %s(R
RtparamstjsontdumpsRtNonetreadtloadst
ValueErrorRR	(R
tqueryRRtresptinfot	json_respte((sV/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/rundeck_project.pytrequest_rundeck_apigs&	'
cC`s'|jd|jjd�\}}|S(Ns
project/%stname(R*RR(R
R&R'((sV/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/rundeck_project.pytget_project_facts~s#c	C`s|j�}|dkr�|jjrW|jjdtdidi|jjdd6�n|jddddi|jjdd6id	6�\}}|d
dkr�|jjdtdid|j��q|jjdd
|d
did|j��n|jjdt	d|d|�dS(NtchangedtbeforetafterR+tprojectsRtPOSTRtconfigRi�Rs/Unhandled HTTP status %d, please report the bug(
R,R!Rt
check_modet	exit_jsontTrueRR*RtFalse(R
tfactsR&R'((sV/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/rundeck_project.pytcreate_or_update_project�s3(cC`s�|j�}|dkr:|jjdtdidi�nO|jjsj|jd|jjddd�n|jjdtd|di�dS(NR-R.R/s
project/%sR+RtDELETE(	R,R!RR4R6R3R*RR5(R
R7((sV/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/rundeck_project.pytremove_project�s"$N(	t__name__t
__module__RRR!R*R,R8R:(((sV/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/rundeck_project.pyR\s				cC`s	tdtdtdddddgdd�d	td
tdd�dtd
tdd�dtdd
dd�dtd
tdddt��dt�}|jddkr�|jdd�nt|�}|jddkr�|j�n |jddkr|j�ndS(Nt
argument_spectstatettypetstrtchoicestpresenttabsenttdefaultR+trequiredRRtintiRtno_logtsupports_check_modeRs!API version should be at least 14(RtdictR5RRRR8R:(Rtrundeck((sV/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/rundeck_project.pytmain�s!	
t__main__(t
__future__RRRR?t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.urlsR
RtobjectRRKR;(((sV/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/rundeck_project.pyt<module>s


"E	

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