�
�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 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_schema_template
short_description: Manage templates in schemas
description:
- Manage templates on Cisco ACI Multi-Site.
author:
- Dag Wieers (@dagwieers)
version_added: '2.8'
options:
tenant:
description:
- The tenant used for this template.
type: str
required: yes
schema:
description:
- The name of the schema.
type: str
required: yes
template:
description:
- The name of the template.
type: str
aliases: [ name ]
display_name:
description:
- The name as displayed on the MSO web interface.
type: str
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
notes:
- Due to restrictions of the MSO REST API this module creates schemas when needed, and removes them when the last template has been removed.
seealso:
- module: mso_schema
- module: mso_schema_site
extends_documentation_fragment: mso
s�
- name: Add a new template to a schema
mso_schema_template:
host: mso_host
username: admin
password: SomeSecretPassword
tenant: Tenant 1
schema: Schema 1
template: Template 1
state: present
delegate_to: localhost
- name: Remove a template from a schema
mso_schema_template:
host: mso_host
username: admin
password: SomeSecretPassword
tenant: Tenant 1
schema: Schema 1
template: Template 1
state: absent
delegate_to: localhost
- name: Query a template
mso_schema_template:
host: mso_host
username: admin
password: SomeSecretPassword
tenant: Tenant 1
schema: Schema 1
template: Template 1
state: query
delegate_to: localhost
register: query_result
- name: Query all templates
mso_schema_template:
host: mso_host
username: admin
password: SomeSecretPassword
tenant: Tenant 1
schema: Schema 1
state: query
delegate_to: localhost
register: query_result
t
( t
AnsibleModule( t MSOModulet mso_argument_specc C` s� t � } | j d t d d d t � d t d d d t � d t d d d d g � 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 } | j d
} t | � } | j d d | �} i | _ | r�d j | � } g | d D] }
|
d ^ qL} | r�| | k r�| j
| � } | d | | _ q�q�| d | _ n d } | d k r | j s�| r�| j d d j | � � q�g | _ n | j � n d j | � }
g } | j | _
| d k r�i | _ | _ | sFqYt | � d k r�i | _ | j s�| j | d d �q�qY| j rYi | _ | j t d d d |
� � qYn�| d k rY| j | � } | d k r�| j j d | � } n | sht d | d t d | d | d | � g d! g � } | d d"