�
�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_bys]
---
module: mso_site
short_description: Manage sites
description:
- Manage sites on Cisco ACI Multi-Site.
author:
- Dag Wieers (@dagwieers)
version_added: '2.8'
options:
apic_password:
description:
- The password for the APICs.
type: str
required: yes
apic_site_id:
description:
- The site ID of the APICs.
type: str
required: yes
apic_username:
description:
- The username for the APICs.
type: str
required: yes
default: admin
site:
description:
- The name of the site.
type: str
required: yes
aliases: [ name ]
labels:
description:
- The labels for this site.
- Labels that do not already exist will be automatically created.
type: list
location:
description:
- Location of the site.
suboptions:
latitude:
description:
- The latitude of the location of the site.
type: float
longitude:
description:
- The longitude of the location of the site.
type: float
urls:
description:
- A list of URLs to reference the APICs.
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
s
- name: Add a new site
mso_site:
host: mso_host
username: admin
password: SomeSecretPassword
site: north_europe
description: North European Datacenter
apic_username: mso_admin
apic_password: AnotherSecretPassword
apic_site_id: 12
urls:
- 10.2.3.4
- 10.2.4.5
- 10.3.5.6
labels:
- NEDC
- Europe
- Diegem
location:
latitude: 50.887318
longitude: 4.447084
state: present
delegate_to: localhost
- name: Remove a site
mso_site:
host: mso_host
username: admin
password: SomeSecretPassword
site: north_europe
state: absent
delegate_to: localhost
- name: Query a site
mso_site:
host: mso_host
username: admin
password: SomeSecretPassword
site: north_europe
state: query
delegate_to: localhost
register: query_result
- name: Query all sites
mso_site:
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` s� t d t d d � d t d d � � } t � } | j d t d d d t � d t d d � d t d d d
d � d t d d
� d t d d d | � d t d d d d g � d t d d d
d d d d d g � d t d d
� � t d | d t d d d d g g d d d d g g g � } | j d } | j d } | j d } | j d } | j d } | d k r�| j d d } | j d d } n | j d }
| j d } t | � } d }
d } | j | j d d � } | r'| j | d | �| _
| j
r9| j
d }
d j d |
� } q9n | j | � | _
|
d k rHn�|
d k r�| j
| _
| j
r�| j r~i | _
q�| j | d d! d"