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_iptun.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZdd
dgZde
fd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys(
---
module: dladm_iptun
short_description: Manage IP tunnel interfaces on Solaris/illumos systems.
description:
    - Manage IP tunnel interfaces on Solaris/illumos systems.
version_added: "2.3"
author: Adam Števko (@xen0l)
options:
    name:
        description:
            - IP tunnel interface name.
        required: true
    temporary:
        description:
            - Specifies that the IP tunnel interface is temporary. Temporary IP tunnel
              interfaces do not persist across reboots.
        required: false
        default: false
        type: bool
    type:
        description:
            - Specifies the type of tunnel to be created.
        required: false
        default: "ipv4"
        choices: [ "ipv4", "ipv6", "6to4" ]
        aliases: ['tunnel_type']
    local_address:
        description:
            - Literal IP address or hostname corresponding to the tunnel source.
        required: false
        aliases: [ "local" ]
    remote_address:
        description:
            - Literal IP address or hostname corresponding to the tunnel destination.
        required: false
        aliases: [ "remote" ]
    state:
        description:
            - Create or delete Solaris/illumos VNIC.
        required: false
        default: "present"
        choices: [ "present", "absent" ]
s�
- name: Create IPv4 tunnel interface 'iptun0'
  dladm_iptun: name=iptun0 local_address=192.0.2.23 remote_address=203.0.113.10 state=present

- name: Change IPv4 tunnel remote address
  dladm_iptun: name=iptun0 type=ipv4 local_address=192.0.2.23 remote_address=203.0.113.11

- name: Create IPv6 tunnel interface 'tun0'
  dladm_iptun: name=tun0 type=ipv6 local_address=192.0.2.23 remote_address=203.0.113.42

- name: Remove 'iptun0' tunnel interface
  dladm_iptun: name=iptun0 state=absent
sz
name:
    description: tunnel interface name
    returned: always
    type: str
    sample: iptun0
state:
    description: state of the target
    returned: always
    type: str
    sample: present
temporary:
    description: specifies if operation will persist across reboots
    returned: always
    type: bool
    sample: True
local_address:
    description: local IP address
    returned: always
    type: str
    sample: 1.1.1.1/32
remote_address:
    description: remote IP address
    returned: always
    type: str
    sample: 2.2.2.2/32
type:
    description: tunnel type
    returned: always
    type: str
    sample: ipv4
(t
AnsibleModuletipv4tipv6t6to4tIPTuncB`sGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`s�||_|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_|jjdt	�|_
dS(Ntnamettypet
local_addresstremote_addresst	temporarytstatetdladm(tmoduletparamsR
RRRRRtget_bin_pathtTruet	dladm_bin(tselfR((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt__init__ts	cC`s\|jg}|jd�|j|j�|jj|�\}}}|dkrTtStSdS(Ns
show-iptuni(RtappendR
Rtrun_commandRtFalse(Rtcmdtrct_((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pytiptun_exists�s
cC`s�|jg}|jd�|jr2|jd�n|jd�|j|j�|jd�|jd|jd|j�|j|j�|jj|�S(Nscreate-iptuns-ts-Ts-aslocal=s,remote=(	RRRRRRR
RR(RR((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pytcreate_iptun�s
	

cC`sR|jg}|jd�|jr2|jd�n|j|j�|jj|�S(Nsdelete-iptuns-t(RRRR
RR(RR((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pytdelete_iptun�s
	cC`s~|jg}|jd�|jr2|jd�n|jd�|jd|jd|j�|j|j�|jj|�S(Nsmodify-iptuns-ts-aslocal=s,remote=(RRRRRR
RR(RR((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pytupdate_iptun�s
	
cC`s`|jg}|jd�|jd�|jd�|jd�|j|j�|jj|�S(Ns
show-iptuns-ps-cslink,type,flags,local,remote(RRR
RR(RR((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt_query_iptun_props�s



cC`s�|j�\}}}t}|dkrk|jd�d\}}|j|ks^|j|krgt}n|S|jjdd|jd|d|�dS(Nit:itmsgs.Failed to query tunnel interface %s propertiesterrR(	R%RtsplitRRRRt	fail_jsonR
(RRtoutR(tNEEDS_UPDATINGtconfigured_localtconfigured_remote((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pytiptun_needs_updating�s	(	t__name__t
__module__RR!R"R#R$R%R/(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyRrs		
			
	cC`s�tdtdtdtdd�dtdddddd	gd
t�dtddddg�d
tddddg�dtdtdd�dtddd
ddg��ddddd
gggdt�}t|�}d}d}d}i}|j|d<|j|d<|j	|d<|j
|d
<|j|d<|j|d<|jdkr�|j
�r�|jrr|jdt�n|j�\}}}|dkr�|jd|jd|d|�q�q�n�|jdkr�|j
�sD|jr�|jdt�n|j�\}}}|dk	r�|dkr�|jd|jd|d|�q�q�|j�r�|j�\}}}|dkr�|jdd|d|jd|d|�q�q�n|dkr�t|d<n
t|d<|r�||d<n|r�||d<n|j|�dS(Nt
argument_specR
trequiredRtstrtdefaultR	taliasesttunnel_typetchoicesRtlocalRtremoteRtboolRtpresenttabsenttrequired_iftsupports_check_modettchangediR'Rs+Error while updating tunnel interface: "%s"tstderrtstdout(RtdictRtSUPPORTED_TYPESRRtNoneR
RRRRRR!t
check_modet	exit_jsonR#R*R"R/R$(RtiptunRR+R(tresult((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pytmain�sf		





	(	%	



t__main__N(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRREtobjectRRKR0(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt<module>s


.!`	C

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