Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/illumos/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZd
e
fd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: dladm_vnic
short_description: Manage VNICs on Solaris/illumos systems.
description:
    - Create or delete VNICs on Solaris/illumos systems.
version_added: "2.2"
author: Adam Števko (@xen0l)
options:
    name:
        description:
            - VNIC name.
        required: true
    link:
        description:
            - VNIC underlying link name.
        required: true
    temporary:
        description:
            - Specifies that the VNIC is temporary. Temporary VNICs
              do not persist across reboots.
        required: false
        default: false
        type: bool
    mac:
        description:
            - Sets the VNIC's MAC address. Must be valid unicast MAC address.
        required: false
        default: false
        aliases: [ "macaddr" ]
    vlan:
        description:
            - Enable VLAN tagging for this VNIC. The VLAN tag will have id
              I(vlan).
        required: false
        default: false
        aliases: [ "vlan_id" ]
    state:
        description:
            - Create or delete Solaris/illumos VNIC.
        required: false
        default: "present"
        choices: [ "present", "absent" ]
sQ
# Create 'vnic0' VNIC over 'bnx0' link
- dladm_vnic:
    name: vnic0
    link: bnx0
    state: present

# Create VNIC with specified MAC and VLAN tag over 'aggr0'
- dladm_vnic:
    name: vnic1
    link: aggr0
    mac: '00:00:5E:00:53:23'
    vlan: 4

# Remove 'vnic0' VNIC
- dladm_vnic:
    name: vnic0
    link: bnx0
    state: absent
sl
name:
    description: VNIC name
    returned: always
    type: str
    sample: "vnic0"
link:
    description: VNIC underlying link name
    returned: always
    type: str
    sample: "igb0"
state:
    description: state of the target
    returned: always
    type: str
    sample: "present"
temporary:
    description: VNIC's persistence
    returned: always
    type: bool
    sample: "True"
mac:
    description: MAC address to use for VNIC
    returned: if mac is specified
    type: str
    sample: "00:00:5E:00:53:42"
vlan:
    description: VLAN to use for VNIC
    returned: success
    type: int
    sample: 42
N(t
AnsibleModuletVNICcB`sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s0^[a-f0-9][2-9a-f0]:([a-f0-9]{2}:){4}[a-f0-9]{2}$cC`sm||_|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_dS(Ntnametlinktmactvlant	temporarytstate(tmoduletparamsR
RRR
RR(tselfR((sN/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pyt__init__}s	cC`sh|jjdt�g}|jd�|j|j�|jj|�\}}}|dkr`tStSdS(Ntdladms	show-vnici(Rtget_bin_pathtTruetappendR
trun_commandtFalse(Rtcmdtrct_((sN/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pytvnic_exists�s
cC`s�|jjdt�g}|jd�|jr>|jd�n|jrg|jd�|j|j�n|jr�|jd�|j|j�n|jd�|j|j�|j|j�|jj	|�S(NRscreate-vnics-ts-ms-vs-l(
RRRRRRR
RR
R(RR((sN/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pytcreate_vnic�s
		
	

cC`s^|jjdt�g}|jd�|jr>|jd�n|j|j�|jj|�S(NRsdelete-vnics-t(RRRRRR
R(RR((sN/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pytdelete_vnic�s
	cC`s"tj|j|j�}|dkS(N(tretmatchtUNICAST_MAC_REGEXRtNone(Rtmac_re((sN/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pytis_valid_unicast_mac�scC`sd|jkodkSS(Nii�(R
(R((sN/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pytis_valid_vlan_id�s(	t__name__t
__module__R"RRRRR%R&(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pyR	ys	
	
			cC`s*tdtdtdt�dtdt�dtddddg�d	tdddd
g�dtdtdd
�dtdddddg��dt�}t|�}d}d}d}i}|j|d<|j|d<|j|d<|j	|d<|j
dk	rY|j�rI|jddd|j
d|jd|jd|jd	|j
�n|j
|d<n|j
dk	r�|j�r�|jddd|j
d|jd|jd|jd	|j
�n|j
|d	<n|jdkrD|j�r�|jr�|jdt�n|j�\}}}|dkrA|jd|jd|d|�qAq�n�|jdkr�|j�s�|jr{|jdt�n|j�\}}}n|dk	r�|dkr�|jd|jd|d|�q�n|dkr�t|d<n
t|d<|r||d<n|r||d<n|j|�dS(Nt
argument_specR
trequiredRRtdefaulttaliasestmacaddrR
tvlan_idRttypetboolRtpresenttchoicestabsenttsupports_check_modettmsgsInvalid unicast MAC addresssInvalid VLAN tagtchangediRtstdouttstderr(RtdictRR#RR	R
RRRRR%t	fail_jsonR
R&Rt
check_modet	exit_jsonRR(RtvnicRtoutterrtresult((sN/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pytmain�st	



				
				
	(	%



t__main__(t
__future__RRRR/t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR tansible.module_utils.basicRtobjectR	RBR'(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_vnic.pyt<module>s


.!G	I

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