Anons79 Mini Shell

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

�
�Udac@`s3ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
yddd
lmZddlmZddlmZddlmZddlmZddlmZWnqek
rIdd
lmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZ de!fd ��YZ"d!e!fd"��YZ#d#e!fd$��YZ$d%�Z%e&d&kr/e%�nd'S((i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatust	certifiedtsupported_bys

---
module: bigip_device_connectivity
short_description: Manages device IP configuration settings for HA on a BIG-IP
description:
  - Manages device IP configuration settings for HA on a BIG-IP. Each BIG-IP device
    has synchronization and failover connectivity information (IP addresses) that
    you define as part of HA pairing or clustering. This module allows you to configure
    that information.
version_added: 2.5
options:
  config_sync_ip:
    description:
      - Local IP address that the system uses for ConfigSync operations.
    type: str
  mirror_primary_address:
    description:
      - Specifies the primary IP address for the system to use to mirror
        connections.
    type: str
  mirror_secondary_address:
    description:
      - Specifies the secondary IP address for the system to use to mirror
        connections.
    type: str
  unicast_failover:
    description:
      - Desired addresses to use for failover operations. Options C(address)
        and C(port) are supported with dictionary structure where C(address) is the
        local IP address that the system uses for failover operations. Port
        specifies the port that the system uses for failover operations. If C(port)
        is not specified, the default value C(1026) will be used.  If you are
        specifying the (recommended) management IP address, use 'management-ip' in
        the address field.
    type: list
  failover_multicast:
    description:
      - When C(yes), ensures that the Failover Multicast configuration is enabled
        and if no further multicast configuration is provided, ensures that
        C(multicast_interface), C(multicast_address) and C(multicast_port) are
        the defaults specified in each option's description. When C(no), ensures
        that Failover Multicast configuration is disabled.
    type: bool
  multicast_interface:
    description:
      - Interface over which the system sends multicast messages associated
        with failover. When C(failover_multicast) is C(yes) and this option is
        not provided, a default of C(eth0) will be used.
    type: str
  multicast_address:
    description:
      - IP address for the system to send multicast messages associated with
        failover. When C(failover_multicast) is C(yes) and this option is not
        provided, a default of C(224.0.0.245) will be used.
    type: str
  multicast_port:
    description:
      - Port for the system to send multicast messages associated with
        failover. When C(failover_multicast) is C(yes) and this option is not
        provided, a default of C(62960) will be used. This value must be between
        0 and 65535.
    type: int
  cluster_mirroring:
    description:
      - Specifies whether mirroring occurs within the same cluster or between
        different clusters on a multi-bladed system.
      - This parameter is only supported on platforms that have multiple blades,
        such as Viprion hardware. It is not supported on VE.
    type: str
    choices:
      - between-clusters
      - within-cluster
    version_added: 2.7
notes:
  - This module is primarily used as a component of configuring HA pairs of
    BIG-IP devices.
  - Requires BIG-IP >= 12.0.0
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s[
- name: Configure device connectivity for standard HA pair
  bigip_device_connectivity:
    config_sync_ip: 10.1.30.1
    mirror_primary_address: 10.1.30.1
    unicast_failover:
      - address: management-ip
      - address: 10.1.30.1
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost
sO
changed:
  description: Denotes if the F5 configuration was updated.
  returned: always
  type: bool
config_sync_ip:
  description: The new value of the C(config_sync_ip) setting.
  returned: changed
  type: str
  sample: 10.1.1.1
mirror_primary_address:
  description: The new value of the C(mirror_primary_address) setting.
  returned: changed
  type: str
  sample: 10.1.1.2
mirror_secondary_address:
  description: The new value of the C(mirror_secondary_address) setting.
  returned: changed
  type: str
  sample: 10.1.1.3
unicast_failover:
  description: The new value of the C(unicast_failover) setting.
  returned: changed
  type: list
  sample: [{'address': '10.1.1.2', 'port': 1026}]
failover_multicast:
  description: Whether a failover multicast attribute has been changed or not.
  returned: changed
  type: bool
multicast_interface:
  description: The new value of the C(multicast_interface) setting.
  returned: changed
  type: str
  sample: eth0
multicast_address:
  description: The new value of the C(multicast_address) setting.
  returned: changed
  type: str
  sample: 224.0.0.245
multicast_port:
  description: The new value of the C(multicast_port) setting.
  returned: changed
  type: int
  sample: 1026
cluster_mirroring:
  description: The current cluster-mirroring setting.
  returned: changed
  type: str
  sample: between-clusters
(t
AnsibleModule(t	iteritems(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(ttransform_name(tf5_argument_spec(tis_valid_ipt
Parametersc	B`s	eZidd6dd6dd6dd6dd	6d
d6dd
6dd6Zdddd	dd
dgZddddd
ddddg	Zddddd
ddddg	Zed��Zed��Zed��Z	ed��Z
ed��Zd�Zd�Z
d�ZRS(tunicast_failovertunicastAddresstconfig_sync_iptconfigsyncIptmulticast_interfacetmulticastInterfacetmulticast_addresstmulticastIptmulticast_portt
multicastPorttmirror_primary_addresstmirrorIptmirror_secondary_addresstmirrorSecondaryIpt
management_iptmanagementIptfailover_multicasttcluster_mirroringcC`sU|jddkrdSt|jd�}|dksB|dkrQtd��n|S(NRii��s;The specified 'multicast_port' must be between 0 and 65535.(t_valuestNonetintR(tselftresult((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR�scC`sX|jddkrdS|jddkr.dS|jddkrEdS|jd�}|S(NRtnonetany6ttany(R(R)R*(R#R$t_get_validated_ip_address(R&R'((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR�scC`sA|jddkrdS|jddkr.dS|jd�}|S(NRR(R)R*(snonesany6R*(R#R$R,(R&R'((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR�scC`sA|jddkrdS|jddkr.dS|jd�}|S(NRR(R)R*(snonesany6R*(R#R$R,(R&R'((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRscC`sA|jddkrdS|jddkr.dS|jd�}|S(NRR(R*(snoneR*(R#R$R,(R&R'((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR
scC`sJyt|�}Wn3tk
r/td��ntk
rEd}nX|S(Ns>The provided 'port' for unicast failover is not a valid numberi(R%t
ValueErrorRt	TypeError(R&tportR'((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyt_validate_unicast_failover_ports


cC`s3|dkr+t|�r|Std��n|SdS(Ns
management-ips='address' field in unicast failover is not a valid IP address(RR(R&taddress((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyt"_validate_unicast_failover_addressscC`s7t|j|�r|j|Stdj|���dS(Ns-The specified '{0}' is not a valid IP address(RR#Rtformat(R&R1((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR,)s(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyRRRRRR0R2R,(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR�sT
								t
ApiParameterscB`seZed��ZRS(cC`s2|jddkrdS|jddkr.dSdS(NR"tbetweensbetween-clustersswithin-cluster(R#R$(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR"2s
(R4R5R:R"(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR;1stModuleParameterscB`seZed��ZRS(cC`s�|jddkrdS|jddgkr1gSg}x|jdD]p}|jdd�}|jdd�}|j|�}|j|�}|jtd|d|d|d|��qEW|r�|SdSdS(NRR(R1R/teffectiveIpt
effectivePorttip(R#R$tgetR2R0tappendtdict(R&R'titemR1R/((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR<s&(R4R5R:R(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR=;stChangescB`seZd�ZRS(cC`s}i}y_xI|jD]>}t||�}t|t�rG|j|�q|||<qW|j|�}Wntk
rxnX|S(N(R8tgetattrt
isinstanceRCtupdatet_filter_paramst	Exception(R&R't
returnabletchange((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyt	to_returnWs
(R4R5RM(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyREVstReportableChangescB`sSeZddddddddgZed��Zed	��Zed
��ZRS(RRRRRRR!RcC`s"|jddkrdS|jdS(NRR(R)(snonesany6(R#(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRmscC`s"|jddkrdS|jdS(NRR(R)(snonesany6(R#(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRsscC`s"|jddkrdS|jdS(NRR(R)(snonesany6(R#(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRys(R4R5R8R:RRR(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRNfs		t
UsableChangescB`sSeZed��Zed��Zed��Zed��Zed��ZRS(cC`s/|jddddgkr dS|jdSdS(NRR)R(R+(R#(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR�scC`s/|jddddgkr dS|jdSdS(NRR)R(R+(R#(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR�scC`s/|jddddgkr dS|jdSdS(NRR)R(R+(R#(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR�scC`s3|jddkrdS|jdr/|jdSdS(NRR((R#R$(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR�s

cC`s2|jddkrdS|jddkr.dSdS(NR"sbetween-clustersR<twithin(R#R$(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR"�s
(R4R5R:RRRRR"(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRO�s
t
DifferencecB`sMeZdd�Zd�Zd�Zd�Zed��Zed��Z	RS(cC`s||_||_dS(N(twantthave(R&RRRS((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RFtAttributeErrort_Difference__default(R&tparamR'((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RFRRRSRU(R&RWtattr1tattr2((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyt	__default�s
cC`srg}xe|D]]}xTt|�D]F\}}||jjkrGd}n|t|�t|�fg7}q Wq
W|S(Ns
management-ip(R	RSRtstr(R&t	failoversR'txtktv((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pytto_tuple�s
	'cC`s�|jjgkr(|jjdkr(dS|jjdkr>dS|jjdkrZ|jjS|j|jj�}|j|jj�}t|�t|�kr�dS|jjSdS(N(RRRRSR$Ratset(R&RRRS((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR�s$
c`s�dddg}�jjtkr��jjdkr[�jjdkr[�jjdkr[dStdt	dddddd�}|Sn t
�fd�|D��r�t	SdS(	NRRRteth0R+iR!c3`s%|]}�jj|dkVqdS(R)R+N(Nsany6sany(RSR#R$(t.0R^(R&(sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pys	<genexpr>�s(RRR!tFalseRSRRRR$RCtTruetall(R&tvaluesR'((R&sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR!�s6	N(
R4R5R$RTRXRVRaR:RR!(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRQ�s				
t
ModuleManagercB`sYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(RAR$RjR
RktclientR=RRR;RSROtchanges(R&targstkwargs((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRT�s
cC`s�t|j|j�}tj}t�}xX|D]P}|j|�}|dkrUq.q.t|t�rt|j	|�q.|||<q.W|r�t
d|�|_tSt
S(NRk(RQRRRSRR9RCRXR$RGRHRORmRfRe(R&tdiffR9tchangedR_RL((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(RrRfRe(R&R'((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyt
should_updatescC`s`t�}|j�}td|jj��}|j�}|j|�|jtd|��|S(NRkRq(RCRHRNRmRM(R&R'Rqt
reportableRm((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pytexec_modules	
cC`sV|j�|_|j�stS|jjr/tS|j�|jj	rR|j
�ntS(N(tread_current_from_deviceRSRsReRjt
check_modeRftupdate_on_deviceRmR"t"update_cluster_mirroring_on_device(R&((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRHs

c	C`s�|jj�}|sdSdj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��nx|dD]�}|dd	kr�d
j|jjd|jjdt|d|d��}|jjj
|d
|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��ndSq�Wt	d��dS(Ns"https://{0}:{1}/mgmt/tm/cm/device/tservertserver_porttcodei�tmessagetitemst
selfDevicettrues%https://{0}:{1}/mgmt/tm/cm/device/{2}t	partitiontnametjsonsThe host device was not found.(Rmt
api_paramsR3RltprovidertapiRAR�R-RR\tcontentR
tpatch(R&RkturitresptresponsetexRD((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRx!sB


cC`s�dj|jjd|jjdd�}i|jjd6}|jjj|d|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d	|kr�t	|d	��q�t	|j��ndS(
Ns"https://{0}:{1}/mgmt/tm/sys/db/{2}RzR{sstatemirror.clustermirroringtvalueR�R|i�R}(R3RlR�RmR"R�R�R�R-RR\R�(R&R�tpayloadR�R�R�((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRyLs

	c	C`s�|j�}dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
r~}tt	|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��nx|dD]}|dd	kr�d
j|jjd|jjdt|d|d��}|jjj|�}y|j�}Wn%tk
rs}tt	|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��n|r�|d
|d<ntd|�Sq�Wtd��dS(Ns"https://{0}:{1}/mgmt/tm/cm/device/RzR{R|i�R}R~RR�s%https://{0}:{1}/mgmt/tm/cm/device/{2}R�R�R�R"RksThe host device was not found.(
t"read_cluster_mirroring_from_deviceR3RlR�R�RAR�R-RR\R�R
R;(R&tdbR�R�R�R�RD((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRv_sB


cC`s�dj|jjd|jjdd�}|jjj|�}y|j�}Wn%tk
ru}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��n|S(Ns"https://{0}:{1}/mgmt/tm/sys/db/{2}RzR{sstatemirror.clustermirroringR|i�R}(
R3RlR�R�RAR�R-RR\R�(R&R�R�R�R�((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR��s

	(R4R5RTRrRsRuRHRxRyRvR�(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRi�s						+		+tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdd�dt�dt�dtdd�dtdd	�d
t�dt�dt�d
tdddg��	}i|_|jjt�|jj|�dddgg|_dS(NRttypeR%RRR!tboolRtlistRRRR"tchoicesswithin-clustersbetween-clusters(Rftsupports_check_modeRCt
argument_specRHRtrequired_together(R&R�((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyRT�s&										(R4R5RT(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyR��scC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�R�R�Rjtmsg(R�RR�R�R�RiRut	exit_jsonRt	fail_jsonR\(tspecRjtmmtresultsR�((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pytmain�s			t__main__N('t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.sixR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
Rt)library.module_utils.network.f5.ipaddressRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont)ansible.module_utils.network.f5.ipaddressRR;R=RERNROtobjectRQRiR�R�R4(((sX/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_connectivity.pyt<module>sF


S3
z
'D�	

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