�
�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
Z d d l
m Z d d l m
Z
m Z m Z d
� Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys5
---
module: mso_tenant
short_description: Manage tenants
description:
- Manage tenants on Cisco ACI Multi-Site.
author:
- Dag Wieers (@dagwieers)
version_added: '2.8'
options:
tenant:
description:
- The name of the tenant.
type: str
required: yes
aliases: [ name ]
display_name:
description:
- The name of the tenant to be displayed in the web UI.
type: str
required: yes
description:
description:
- The description for this tenant.
type: str
users:
description:
- A list of associated users for this tenant.
- Using this property will replace any existing associated users.
type: list
sites:
description:
- A list of associated sites for this tenant.
- Using this property will replace any existing associated sites.
type: list
state:
description:
- Use C(present) or C(absent) for adding or removing.
- Use C(query) for listing an object or multiple objects.
type: str
choices: [ absent, present, query ]
default: present
extends_documentation_fragment: mso
sM
- name: Add a new tenant
mso_tenant:
host: mso_host
username: admin
password: SomeSecretPassword
tenant: north_europe
display_name: North European Datacenter
description: This tenant manages the NEDC environment.
state: present
delegate_to: localhost
- name: Remove a tenant
mso_tenant:
host: mso_host
username: admin
password: SomeSecretPassword
tenant: north_europe
state: absent
delegate_to: localhost
- name: Query a tenant
mso_tenant:
host: mso_host
username: admin
password: SomeSecretPassword
tenant: north_europe
state: query
delegate_to: localhost
register: query_result
- name: Query all tenants
mso_tenant:
host: mso_host
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
t
( t
AnsibleModule( t MSOModulet mso_argument_spect issubsetc C` sX t � } | j d t d d � d t d d � d t d d d d g � d t d d � d
t d d � d t d d d d
d d d
d g � � t d | d t d d d d g g d d
d g g g � } | j d } | j d } | j d } | j d } t | � } | j | j d
� } | j | j d � } d } d }
| r�| j
|
d | �| _ | j r�| j d } d j d | � }
q�n | j
|
� | _ | d k r�n�| d k r�| j | _ | j rJ| j r�i | _ q�| j |
d d �| _ qJnM| d
k rJ| j | _ t d | d | d | d | d | d | � } | j | d t �| j j d � d k r}| | j d <n | j j d � d k r�t d d � g | j d <n | j rt | j | j � sG| j r�| j | _ q| j |
d d d | j �| _ qGqJ| j r&| j | _ qJ| j |
d d! d | j �| _ n | j � d S("