Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/modules/source_control/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pyc

�
�Udac@`sUddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlZdZyddlZeZWn#ek
r�ej�ZeZnXddlmZdd
lmZmZddlmZyeWnek
rd�ZnXdefd��YZd�Z d�Z!e"dkrQe!�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�

---
module: gitlab_runner
short_description: Create, modify and delete GitLab Runners.
description:
  - Register, update and delete runners with the GitLab API.
  - All operations are performed using the GitLab API v4.
  - For details, consult the full API documentation at U(https://docs.gitlab.com/ee/api/runners.html).
  - A valid private API token is required for all operations. You can create as many tokens as you like using the GitLab web interface at
    U(https://$GITLAB_URL/profile/personal_access_tokens).
  - A valid registration token is required for registering a new runner.
    To create shared runners, you need to ask your administrator to give you this token.
    It can be found at U(https://$GITLAB_URL/admin/runners/).
notes:
  - To create a new runner at least the C(api_token), C(description) and C(url) options are required.
  - Runners need to have unique descriptions.
version_added: 2.8
author:
  - Samy Coenen (@SamyCoenen)
  - Guillaume Martinez (@Lunik)
requirements:
  - python >= 2.7
  - python-gitlab <= 1.12.1
extends_documentation_fragment:
    - auth_basic
options:
  url:
    description:
      - The URL of the GitLab server, with protocol (i.e. http or https).
    type: str
  api_token:
    description:
      - Your private token to interact with the GitLab API.
    required: True
    type: str
    aliases:
      - private_token
  description:
    description:
      - The unique name of the runner.
    required: True
    type: str
    aliases:
      - name
  state:
    description:
      - Make sure that the runner with the same name exists with the same configuration or delete the runner with the same name.
    required: False
    default: present
    choices: ["present", "absent"]
    type: str
  registration_token:
    description:
      - The registration token is used to register new runners.
    required: True
    type: str
  active:
    description:
      - Define if the runners is immediately active after creation.
    required: False
    default: yes
    type: bool
  locked:
    description:
      - Determines if the runner is locked or not.
    required: False
    default: False
    type: bool
  access_level:
    description:
      - Determines if a runner can pick up jobs from protected branches.
    required: False
    default: ref_protected
    choices: ["ref_protected", "not_protected"]
    type: str
  maximum_timeout:
    description:
      - The maximum timeout that a runner has to pick up a specific job.
    required: False
    default: 3600
    type: int
  run_untagged:
    description:
      - Run untagged jobs or not.
    required: False
    default: yes
    type: bool
  tag_list:
    description: The tags that apply to the runner.
    required: False
    default: []
    type: list
s�
- name: "Register runner"
  gitlab_runner:
    api_url: https://gitlab.example.com/
    api_token: "{{ access_token }}"
    registration_token: 4gfdsg345
    description: Docker Machine t1
    state: present
    active: True
    tag_list: ['docker']
    run_untagged: False
    locked: False

- name: "Delete runner"
  gitlab_runner:
    api_url: https://gitlab.example.com/
    api_token: "{{ access_token }}"
    description: Docker Machine t1
    state: absent
s�
msg:
  description: Success or failure message
  returned: always
  type: str
  sample: "Success"

result:
  description: json parsed response from the server
  returned: always
  type: dict

error:
  description: the error message returned by the GitLab API
  returned: failed
  type: str
  sample: "400: path is already in use"

runner:
  description: API object
  returned: always
  type: dict
N(tbasic_auth_argument_spec(t
AnsibleModuletmissing_required_lib(t	to_nativecC`s||k||kS(N((tatb((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pytcmp�stGitLabRunnercB`sGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`s||_||_d|_dS(N(t_modulet_gitlabtNonetrunnerObject(tselftmoduletgitlab_instance((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pyt__init__�s		cC`s[t}|jdkrv|ji|d6|dd6|dd6|dd6|dd6|dd6|dd6�}t}n]|j|ji|dd6|dd6|dd6|dd6|d	d	6|dd6�\}}||_|rS|jjr|jjd
tdd|�ny|j	�Wn0t
k
rN}|jjdd
t|��nXtStSdS(Ntdescriptiontactivetregistration_tokenttokentlockedtrun_untaggedtmaximum_timeoutttag_listtaccess_leveltchangedtmsgs-Successfully created or updated the runner %ssFailed to update runner: %s (
tFalseRRtcreateRunnertTruetupdateRunnerRt
check_modet	exit_jsontsavet	Exceptiont	fail_jsonR(RRtoptionsR!trunnerte((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pytcreateOrUpdateRunner�s8			 !cC`sf|jjrtSy|jjj|�}Wn6tjjk
ra}|jj	ddt
|��nX|S(NR"sFailed to create runner: %s (RR'R%Rtrunnerstcreatetgitlabt
exceptionstGitlabCreateErrorR+R(Rt	argumentsR-R.((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pyR$�s!cC`s�t}x�|j�D]�\}}||dk	rt||t�r�t||�}|j�||}|j�t||�r�t||||�t	}q�q�t||�||kr�t||||�t	}q�qqW||fS(N(
R#titemsRt
isinstancetlisttgetattrtsortRtsetattrR%(RR-R5R!targ_keyt	arg_valuetlist1tlist2((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pyR&�s


cC`sT|jjjdt�}x5|D]-}|d|kr|jjj|d�SqWdS(Ntas_listRtid(RR0tallR#tget(RRR0R-((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pyt
findRunners
cC`s&|j|�}|r"||_tStS(N(RDRR%R#(RRR-((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pytexistsRunner
s
	cC`s#|jjrtS|j}|j�S(N(RR'R%Rtdelete(RR-((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pytdeleteRunners	(	t__name__t
__module__RR/R$R&RDRERG(((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pyR�s		'						cC`sLdg}x<|D]4}||jkr|jdjd|�d�qqWdS(Nt
private_tokensAlias '{aliase}' is deprecatedtaliases2.10(tparamst	deprecatetformat(Rtdeprecated_aliasesRK((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pytdeprecation_warnings	
cC`s�t�}|jtdtdddd�dtdddtdd	g�d
tdddtddg�d
tdddt�dtdddg�dtdddt�dtdddt�dtdddddddg�dtdddd�dtdddtdt�dtdddddddg���td|d d!dgd"dgd#dggd$d"d#gd%d&ggd'd"dgd!dggd(t�}t|�|jddk	r�t	j
d)d*|jd�}n|jd!}|jd+}|dkr�|n|}|jd"}|jd#}|jd}|jd}	|jd
}
|jd
}|jd}|jd}
|jd}|jd}|jd}|jd}ts�|jd,t
d-�d.t�ny>tjd|d/|d0|d1|d	|d2d3�}|j�Wnqtjjtjjfk
rD}|jd,d4t|��n3tjjk
rv}|jd,d5t|��nXt||�}|j|
�}|	dkr�|r�|j�|jd6td,d7|
�q�|jd6td,d8�n|	dkr�|j|
i|d
6|d6|
d6|d6|d6|d6|d6�r_|jd6td9|jjd,d:|
�q�|jd6td9|jjd,d;|
�ndS(<Nturlttypetstrtremoved_in_versions2.10t	api_tokentno_logtaliasesRJRtrequiredtnameRtbooltdefaultRR8RRR t
ref_protectedtchoicest
not_protectedRtintiRtstatetpresenttabsentt
argument_spectmutually_exclusivetapi_urltapi_usernametapi_passwordtrequired_togethert
login_usertlogin_passwordtrequired_one_oftsupports_check_modes/api.*ttvalidate_certsR"s
python-gitlabt	exceptiont
ssl_verifytemailtpasswordtapi_versionis&Failed to connect to GitLab server: %ss�Failed to connect to GitLab server: %s.             GitLab remove Session API now that private tokens are removed from user API endpoints since version 10.2R!sSuccessfully deleted runner %ss!Runner deleted or does not existsR-s-Successfully created or updated the runner %ssNo need to update the runner %s(RtupdatetdictR%R#R	RPRLRtretsubtHAS_GITLAB_PACKAGER+R
tGITLAB_IMP_ERRR2tGitlabtauthR3tGitlabAuthenticationErrortGitlabGetErrorRtGitlabHttpErrorRRERGR(R/Rt_attrs(RcRRQReRnt
gitlab_urltgitlab_usertgitlab_passwordtgitlab_tokenR`trunner_descriptiont
runner_activeRRt
runner_lockedR RRRR.t
gitlab_runnert
runner_exists((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pytmain's�	!%					














!!	

t__main__(#t
__future__RRRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtosRvt	tracebackRRyR2R%RxR*t
format_excR#tansible.module_utils.apiRtansible.module_utils.basicR	R
tansible.module_utils._textRRt	NameErrortobjectRRPR�RH(((sP/usr/lib/python2.7/site-packages/ansible/modules/source_control/gitlab_runner.pyt<module>s:


^




n		`

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