Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/remote_management/ucs/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_vnic_template.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZd
�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys
---
module: ucs_vnic_template
short_description: Configures vNIC templates on Cisco UCS Manager
description:
- Configures vNIC templates on Cisco UCS Manager.
- Examples can be used with the UCS Platform Emulator U(https://communities.cisco.com/ucspe).
extends_documentation_fragment: ucs
options:
  state:
    description:
    - If C(present), will verify vNIC templates are present and will create if needed.
    - If C(absent), will verify vNIC templates are absent and will delete if needed.
    choices: [present, absent]
    default: present
  name:
    description:
    - The name of the vNIC template.
    - This name can be between 1 and 16 alphanumeric characters.
    - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)."
    - You cannot change this name after the template is created.
    required: yes
  description:
    description:
    - A user-defined description of the vNIC template.
    - Enter up to 256 characters.
    - "You can use any characters or spaces except the following:"
    - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)."
    aliases: [ descr ]
  fabric:
    description:
    - The Fabric ID field specifying the fabric interconnect associated with vNICs created from this template.
    - If you want fabric failover enabled on vNICs created from this template, use of of the following:"
    - "A-B to use Fabric A by default with failover enabled."
    - "B-A to use Fabric B by default with failover enabled."
    - "Do not enable vNIC fabric failover under the following circumstances:"
    - "- If the Cisco UCS domain is running in Ethernet switch mode. vNIC fabric failover is not supported in that mode."
    - "- If you plan to associate one or more vNICs created from this template to a server with an adapter that does not support fabric failover."
    choices: [A, B, A-B, B-A]
    default: A
  redundancy_type:
    description:
    - The Redundancy Type used for vNIC redundancy pairs during fabric failover.
    - "This can be one of the following:"
    - "primary — Creates configurations that can be shared with the Secondary template."
    - "secondary — All shared configurations are inherited from the Primary template."
    - "none - Legacy vNIC template behavior. Select this option if you do not want to use redundancy."
    choices: [none, primary, secondary]
    default: none
  peer_redundancy_template:
    description:
    - The Peer Redundancy Template.
    - The name of the vNIC template sharing a configuration with this template.
    - If the redundancy_type is primary, the name of the secondary template should be provided.
    - If the redundancy_type is secondary, the name of the primary template should be provided.
    - Secondary templates can only configure non-shared properties (name, description, and mac_pool).
    aliases: [ peer_redundancy_templ ]
  target:
    description:
    - The possible target for vNICs created from this template.
    - The target determines whether or not Cisco UCS Manager automatically creates a VM-FEX port profile with the appropriate settings for the vNIC template.
    - "This can be one of the following:"
    - "adapter — The vNICs apply to all adapters. No VM-FEX port profile is created if you choose this option."
    - "vm - The vNICs apply to all virtual machines. A VM-FEX port profile is created if you choose this option."
    default: adapter
  template_type:
    description:
    - The Template Type field.
    - "This can be one of the following:"
    - "initial-template — vNICs created from this template are not updated if the template changes."
    - "updating-template - vNICs created from this template are updated if the template changes."
    choices: [initial-template, updating-template]
    default: initial-template
  vlans_list:
    description:
    - List of VLANs used by the vNIC template.
    - "Each list element has the following suboptions:"
    - "= name"
    - "  The name of the VLAN (required)."
    - "- native"
    - "  Designates the VLAN as a native VLAN.  Only one VLAN in the list can be a native VLAN."
    - "  [choices: 'no', 'yes']"
    - "  [Default: 'no']"
    - "- state"
    - "  If present, will verify VLAN is present on template."
    - "  If absent, will verify VLAN is absent on template."
    - "  choices: [present, absent]"
    - "  default: present"
  cdn_source:
    description:
    - CDN Source field.
    - "This can be one of the following options:"
    - "vnic-name - Uses the vNIC template name of the vNIC instance as the CDN name. This is the default option."
    - "user-defined - Uses a user-defined CDN name for the vNIC template. If this option is chosen, cdn_name must also be provided."
    choices: [vnic-name, user-defined]
    default: vnic-name
  cdn_name:
    description:
    - CDN Name used when cdn_source is set to user-defined.
  mtu:
    description:
    - The MTU field.
    - The maximum transmission unit, or packet size, that vNICs created from this vNIC template should use.
    - Enter a string between '1500' and '9000'.
    - If the vNIC template has an associated QoS policy, the MTU specified here must be equal to or less than the MTU specified in the QoS system class.
    default: '1500'
  mac_pool:
    description:
    - The MAC address pool that vNICs created from this vNIC template should use.
  qos_policy:
    description:
    - The quality of service (QoS) policy that vNICs created from this vNIC template should use.
  network_control_policy:
    description:
    - The network control policy that vNICs created from this vNIC template should use.
  pin_group:
    description:
    - The LAN pin group that vNICs created from this vNIC template should use.
  stats_policy:
    description:
    - The statistics collection policy that vNICs created from this vNIC template should use.
    default: default
  org_dn:
    description:
    - Org dn (distinguished name)
    default: org-root
requirements:
- ucsmsdk
author:
- David Soper (@dsoper2)
- CiscoUcs (@CiscoUcs)
version_added: '2.5'
s
- name: Configure vNIC template
  ucs_vnic_template:
    hostname: 172.16.143.150
    username: admin
    password: password
    name: vNIC-A
    fabric: A
    vlans_list:
    - name: default
      native: 'yes'

- name: Configure vNIC template with failover
  ucs_vnic_template:
    hostname: 172.16.143.150
    username: admin
    password: password
    name: vNIC-A-B
    fabric: A-B
    vlans_list:
    - name: default
      native: 'yes'
      state: present

- name: Remove vNIC template
  ucs_vnic_template:
    hostname: 172.16.143.150
    username: admin
    password: password
    name: vNIC-A
    state: absent

- name: Remove another vNIC template
  ucs_vnic_template:
    hostname: 172.16.143.150
    username: admin
    password: password
    name: vNIC-A-B
    state: absent

- name: Remove VLAN from template
  ucs_vnic_template:
    hostname: 172.16.143.150
    username: admin
    password: password
    name: vNIC-A-B
    fabric: A-B
    vlans_list:
    - name: default
      native: 'yes'
      state: absent
s
#
(t
AnsibleModule(t	UCSModuletucs_argument_specc,C`s�t}|jdtdddd�dtdddt�dtddd	d
gdd�dtdddd
dd
dddg�dtddddddddg�dtddd	dgdd�dtdddddddg�dtdddddddg�dtdd�d tdddd!dd!d"g�d#tdddd�d$tdddd%�d&tdddd�d'tdddd�d(tdddd�d)tdddd�d*tdddd�d+tdddd,dd,d-g��t|d.td/d d"d#ggg�}t|�}t}d0d1lm}d0d2l	m
}t}y3t}t}|jdd3|jd}	|jj
|	�}
|
r�t}n|jd+d-kr�|rx|js�|jj|
�|jj�nt}qxn�|jjd�rExP|jdD]>}|jd4�s"d5|d4<n|jd+�sd,|d+<qqWn|jddkrhd6|jd<n|rGtd
|jd�}|jd|d7<|jd|d8<|jd|d9<|jd&|d:<|jddkrw|jd|d<|jd|d;<|jd |d <|jd#|d<<|jd$|d$<|jd'|d=<|jd(|d><|jd)|d?<|jd*|d@<n|
j|�rG|jjd�s�t}qDx�|jdD]�}|	dAt|d�}
|jj
|
�}|d+d-kr|r=t}Pq=q�|r6tdB|d4�}|j|�r=t}q=q�t}Pq�WqGn|sx|jso|jddkr�|dC|jdd|jdd
|jdd7|jdd8|jdd9|jdd:|jd&�}
n�|dC|jdd|jdd
|jdd7|jdd8|jdd9|jdd|jdd;|jdd |jd d<|jd#d$|jd$d:|jd&d=|jd'd>|jd(d?|jd)d@|jd*�}
|jjd�rLx�|jdD]|}|d+d-kr|	dAt|d�}
|jj
|
�}|jj|�q�|dC|
dt|d�dB|d4�}q�Wn|jj|
t�|jj�nt}nWn0tk
r�}t}dDt|�|jdE<nX||jdF<|r�|j|j�n|j|j�dS(GNtorg_dnttypetstrtdefaultsorg-roottnametrequiredtdescriptiontaliasestdescrttfabrictAtchoicestBsA-BsB-Atredundancy_typetnonetprimaryt	secondarytpeer_redundancy_templatetpeer_redundancy_templttargettadaptertvmt
template_typesinitial-templatesupdating-templatet
vlans_listtlistt
cdn_sources	vnic-namesuser-definedtcdn_nametmtut1500tmac_poolt
qos_policytnetwork_control_policyt	pin_grouptstats_policytstatetpresenttabsenttsupports_check_modetrequired_ifi(tVnicLanConnTempl(tVnicEtherIfs/lan-conn-templ-tnativetnotadaptort	switch_idtredundancy_pair_typetpeer_redundancy_templ_nametident_pool_namet
templ_typetadmin_cdn_nametqos_policy_nametnw_ctrl_policy_nametpin_to_group_nametstats_policy_names/if-tdefault_nettparent_mo_or_dnssetup error: %s tmsgtchanged(R
tupdatetdicttTrueRR	tFalset$ucsmsdk.mometa.vnic.VnicLanConnTemplR3tucsmsdk.mometa.vnic.VnicEtherIfR4tparamstlogin_handletquery_dnt
check_modet	remove_motcommittgettcheck_prop_matchR
tadd_mot	Exceptiontresultt	fail_jsont	exit_json(t
argument_spectmoduletucsterrR3R4REt	mo_existstprops_matchtdntmotvlantkwargstchild_dntmo_1te((s[/usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_vnic_template.pytmain�s	'$!!!"		
		






















t__main__N(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt*ansible.module_utils.remote_management.ucsR	R
Rft__name__(((s[/usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_vnic_template.pyt<module>s


�5	�

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