Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_role.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zdd
l	m
Z
mZmZy/ddl
Z
ddljZddlmZWnek
r�nXd
�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: tower_role
version_added: "2.3"
author: "Wayne Witzel III (@wwitzel3)"
short_description: create, update, or destroy Ansible Tower role.
description:
    - Create, update, or destroy Ansible Tower roles. See
      U(https://www.ansible.com/tower) for an overview.
options:
    user:
      description:
        - User that receives the permissions specified by the role.
    team:
      description:
        - Team that receives the permissions specified by the role.
    role:
      description:
        - The role type to grant/revoke.
      required: True
      choices: ["admin", "read", "member", "execute", "adhoc", "update", "use", "auditor", "project_admin", "inventory_admin", "credential_admin",
                "workflow_admin", "notification_admin", "job_template_admin"]
    target_team:
      description:
        - Team that the role acts on.
    inventory:
      description:
        - Inventory the role acts on.
    job_template:
      description:
        - The job template the role acts on.
    credential:
      description:
        - Credential the role acts on.
    organization:
      description:
        - Organization the role acts on.
    project:
      description:
        - Project the role acts on.
    state:
      description:
        - Desired state of the resource.
      default: "present"
      choices: ["present", "absent"]
extends_documentation_fragment: tower
s�
- name: Add jdoe to the member role of My Team
  tower_role:
    user: jdoe
    target_team: "My Team"
    role: member
    state: present
    tower_config_file: "~/tower_cli.cfg"
(tTowerModulettower_auth_configttower_check_modeN(tsettingsc	C`s|j�}idd6dd6dd6dd6dd6dd6dd	6dd
6}x�|j�D]�\}}yZ||r�|dkr�dn|}tj|�ji|||6�}|d||<nWqWtjk
r�}|jdd
j||�dt	�qWXqWW|S(srupdate_resources attempts to fetch any of the resources given
    by name using their unique field (identity)
    tusernametusertnametteamttarget_teamt	inventorytjob_templatet
credentialtorganizationtprojecttidtmsgs)Failed to update role, {0} not found: {1}tchanged(
tcopytitemst	tower_clitget_resourcetgettexctNotFoundt	fail_jsontformattFalse(	tmoduletptparamstidentity_maptktvtkeytresulttexcinfo((s_/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_role.pytupdate_resourcesVs&

#*c
C`stdt�dt�dtdddddd	d
ddd
dddddg�dt�dt�dt�dt�dt�dt�dtdddgdd��
}td|dt�}|jjd�}|jjd�}i|d6|d6}t|�}tj|���t|�t	j
d�}t||j�}||d<yN|dkrr|j|�}|d |d <n|dkr�|j
|�}nWnJtjtjtjtjfk
r�}	|jd!d"j|	�d#t�nXWdQX|d#|d#<|j|�dS($NR
Rtroletchoicestadmintreadtmembertexecutetadhoctupdatetusetauditort
project_admintinventory_admintcredential_admintworkflow_admintnotification_admintjob_template_adminRRRRRRtstatetpresenttabsenttdefaultt
argument_spectsupports_check_modettypeRRsFailed to update role: {0}R(tdictRtTrueR%tpopR	Rtruntime_valuesR
RRR,tgranttrevokeRtConnectionErrort
BadRequestRt	AuthErrorR R!R"t	exit_json(
RAR#t	role_typeR=tjson_outputt
tower_authR-R%R*R+((s_/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_role.pytmainps@		'						

')t__main__(t
__future__RRRRCt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLESt"ansible.module_utils.ansible_towerRR	R
Rttower_cli.exceptionst
exceptionsRttower_cli.confRtImportErrorR,RQt__name__(((s_/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_role.pyt<module>s"


1
		,

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