�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d d
l m
Z
m Z m Z y/ d d l
Z
d d l j Z d d l m Z Wn e k
r� n Xd
� Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
---
module: tower_team
author: "Wayne Witzel III (@wwitzel3)"
version_added: "2.3"
short_description: create, update, or destroy Ansible Tower team.
description:
- Create, update, or destroy Ansible Tower teams. See
U(https://www.ansible.com/tower) for an overview.
options:
name:
description:
- Name to use for the team.
required: True
organization:
description:
- Organization the team should be made a member of.
required: True
state:
description:
- Desired state of the resource.
choices: ["present", "absent"]
default: "present"
extends_documentation_fragment: tower
s�
- name: Create tower team
tower_team:
name: Team Name
description: Team Description
organization: test-org
state: present
tower_config_file: "~/tower_cli.cfg"
( t TowerModulet tower_auth_configt tower_check_modeN( t settingsc
C` s, t d t d t � d t � d t d t � d t d d d g d d � � } t d
| d t � } | j j d � } | j j d � } | j j d � } | j j d � } i | d 6| d 6} t | � } t j | � �4t | � t j
d � } y� t j
d � } | j d | � }
| d k rZ| j d | d |
d
d | d t � } | d
| d
<n+ | d k r�| j d | d |
d
� } n Wn~ t
j k
r�} | j d d j | � d t � nJ t
j t
j t
j t
j f k
r} | j d d j | � d t � n XWd QX| d | d <| j | � d S( Nt namet requiredt descriptiont organizationt statet choicest presentt absentt defaultt
argument_spect supports_check_modet teamt idt create_on_missingt msgs2 Failed to update team, organization not found: {0}t changeds Failed to update team: {0}( t dictt TrueR t paramst getR R t runtime_valuesR
t tower_clit get_resourcet modifyt deletet exct NotFoundt fail_jsont formatt Falset ConnectionErrort
BadRequestt AuthErrort exit_json(
R t moduleR R R R t json_outputt
tower_authR t org_rest orgt resultt excinfo( ( s_ /usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_team.pyt main@ s<