�
�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
d g Z d e
f d � � YZ 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: 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
AnsibleModulet ipv4t ipv6t 6to4t IPTunc B` sG e Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( c C` s� | | _ | j d | _ | j d | _ | j d | _ | j d | _ | j d | _ | j d | _ | j j d t � | _
d S( Nt namet typet
local_addresst remote_addresst temporaryt statet dladm( t modulet paramsR
R R R R R t get_bin_patht Truet dladm_bin( t selfR ( ( sO /usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt __init__t s c C` s\ | j g } | j d � | j | j � | j j | � \ } } } | d k rT t St Sd S( Ns
show-iptuni ( R t appendR
R t run_commandR t False( R t cmdt rct _( ( sO /usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt iptun_exists� s
c C` s� | j g } | j d � | j r2 | j d � n | j d � | j | j � | j d � | j d | j d | j � | j | j � | j j | � S( Ns create-iptuns -ts -Ts -as local=s ,remote=( R R R R R R R
R R ( R R ( ( sO /usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt create_iptun� s
c C` sR | j g } | j d � | j r2 | j d � n | j | j � | j j | � S( Ns delete-iptuns -t( R R R R
R R ( R R ( ( sO /usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt delete_iptun� s
c C` s~ | j g } | j d � | j r2 | j d � n | j d � | j d | j d | j � | j | j � | j j | � S( Ns modify-iptuns -ts -as local=s ,remote=( R R R R R R
R R ( R R ( ( sO /usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt update_iptun� s
c C` s` | j g } | j d � | j d � | j d � | j d � | j | j � | j j | � S( Ns
show-iptuns -ps -cs link,type,flags,local,remote( R R R
R R ( R R ( ( sO /usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt _query_iptun_props� s
c C` s� | j � \ } } } t } | d k rk | j d � d \ } } | j | k s^ | j | k rg t } n | S| j j d d | j d | d | � d S( Ni t :i t msgs. Failed to query tunnel interface %s propertiest errR ( R% R t splitR R R R t fail_jsonR
( R R t outR( t NEEDS_UPDATINGt configured_localt configured_remote( ( sO /usr/lib/python2.7/site-packages/ansible/modules/network/illumos/dladm_iptun.pyt iptun_needs_updating� s ( t __name__t
__module__R R! R"