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_group.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
yDdd
lmZddlmZddlmZddlmZWnQek
r	dd
lmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd ��YZd!�Z e!d"kr�e �nd#S($i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatust	certifiedtsupported_bysk
---
module: bigip_device_group
short_description: Manage device groups on a BIG-IP
description:
  - Managing device groups allows you to create HA pairs and clusters
    of BIG-IP devices. Usage of this module should be done in conjunction
    with the C(bigip_configsync_actions) to sync configuration across
    the pair or cluster if auto-sync is disabled.
version_added: 2.5
options:
  name:
    description:
      - Specifies the name of the device group.
    type: str
    required: True
  type:
    description:
      - Specifies that the type of group.
      - A C(sync-failover) device group contains devices that synchronize their
        configuration data and fail over to one another when a device becomes
        unavailable.
      - A C(sync-only) device group has no such failover. When creating a new
        device group, this option will default to C(sync-only).
      - This setting cannot be changed once it has been set.
    type: str
    choices:
      - sync-failover
      - sync-only
  description:
    description:
      - Description of the device group.
    type: str
  auto_sync:
    description:
      - Indicates whether configuration synchronization occurs manually or
        automatically.
      - When creating a new device group, this option will default to C(no).
    type: bool
  save_on_auto_sync:
    description:
      - When performing an auto-sync, specifies whether the configuration
        will be saved or not.
      - When C(no), only the running configuration will be changed on the
        device(s) being synced to.
      - When creating a new device group, this option will default to C(no).
    type: bool
  full_sync:
    description:
      - Specifies whether the system synchronizes the entire configuration
        during synchronization operations.
      - When C(no), the system performs incremental synchronization operations,
        based on the cache size specified in C(max_incremental_sync_size).
      - Incremental configuration synchronization is a mechanism for synchronizing
        a device-group's configuration among its members, without requiring a
        full configuration load for each configuration change.
      - In order for this to work, all devices in the device-group must initially
        agree on the configuration. Typically this requires at least one full
        configuration load to each device.
      - When creating a new device group, this option will default to C(no).
    type: bool
  max_incremental_sync_size:
    description:
      - Specifies the size of the changes cache for incremental sync.
      - For example, using the default, if you make more than 1024 KB worth of
        incremental changes, the system performs a full synchronization operation.
      - Using incremental synchronization operations can reduce the per-device sync/load
        time for configuration changes.
      - This setting is relevant only when C(full_sync) is C(no).
    type: int
  state:
    description:
      - When C(state) is C(present), ensures the device group exists.
      - When C(state) is C(absent), ensures that the device group is removed.
    type: str
    choices:
      - present
      - absent
    default: present
  network_failover:
    description:
      - Indicates whether failover occurs over the network or is hard-wired.
      - This parameter is only valid for C(type)'s that are C(sync-failover).
    type: bool
    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.1.x.
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Create a sync-only device group
  bigip_device_group:
    name: foo-group
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Create a sync-only device group with auto-sync enabled
  bigip_device_group:
    name: foo-group
    auto_sync: yes
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
sg
save_on_auto_sync:
  description: The new save_on_auto_sync value of the device group.
  returned: changed
  type: bool
  sample: true
full_sync:
  description: The new full_sync value of the device group.
  returned: changed
  type: bool
  sample: false
description:
  description: The new description of the device group.
  returned: changed
  type: str
  sample: this is a device group
type:
  description: The new type of the device group.
  returned: changed
  type: str
  sample: sync-failover
auto_sync:
  description: The new auto_sync value of the device group.
  returned: changed
  type: bool
  sample: true
max_incremental_sync_size:
  description: The new sync size of the device group
  returned: changed
  type: int
  sample: 1000
network_failover:
  description: Whether or not network failover is enabled.
  returned: changed
  type: bool
  sample: yes
(t
AnsibleModule(t
BOOLEANS_TRUE(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spect
ParameterscB`s�eZidd6dd6dd6dd6dd	6Zddd
dddd	gZddd
ddddgZddd
dddgZed��ZRS(
tsave_on_auto_synctsaveOnAutoSynct	full_synctfullLoadOnSynct	auto_synctautoSynctmax_incremental_sync_sizetincrementalConfigSyncSizeMaxtnetwork_failovertnetworkFailovertdescriptionttypecC`s�|jri|jddk	ri|jddkr@g|jd<n|jdjtdddd�g�n|jddkr�dSt|jd�S(NRt
__warningstmsgsC"max_incremental_sync_size has no effect if "full_sync" is not truetversions2.4(Rt_valuestNonetappendtdicttint(tself((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR�s
(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyR(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR�s6
			t
ApiParameterscB`sDeZed��Zed��Zed��Zed��ZRS(cC`s2|jddkrdS|jddkr.tStS(NRtenabled(RRtTruetFalse(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR�s
cC`s2|jddkrdS|jddkr.tStS(NRR,(RRR-R.(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR�s
cC`s6|jddkrdS|jdtkr.tStSdS(NR(RRR	R-R.(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR�s
cC`s6|jddkrdS|jdtkr.tStSdS(NR(RRR	R-R.(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRs
(R$R%R*RRRR(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR+�s	tModuleParameterscB`seZRS((R$R%(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR/stChangescB`seZd�ZRS(cC`s}i}y_xI|jD]>}t||�}t|t�rG|j|�q|||<qW|j|�}Wntk
rxnX|S(N(R(tgetattrt
isinstanceR!tupdatet_filter_paramst	Exception(R#tresultt
returnabletchange((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyt	to_returns
(R$R%R9(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR0st
UsableChangescB`sDeZed��Zed��Zed��Zed��ZRS(cC`s,|jddkrdS|jdr(dSdS(NRR,tdisabled(RR(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR&s

cC`s,|jddkrdS|jdr(dSdS(NRR,R;(RR(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR.s

cC`s6|jddkrdS|jdtkr.dSdSdS(NRttruetfalse(RRR	(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR6s
cC`s6|jddkrdS|jdtkr.dSdSdS(NRR<R=(RRR	(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR?s
(R$R%R*RRRR(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR:%s	tReportableChangescB`sDeZed��Zed��Zed��Zed��ZRS(cC`s2|jddkrdS|jddkr.dSdS(NRR,tyestno(RR(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRJs
cC`s2|jddkrdS|jddkr.dSdS(NRR,R?R@(RR(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRRs
cC`s2|jddkrdS|jdtkr.dSdS(NRR?R@(RRR	(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRZs
cC`s2|jddkrdS|jdtkr.dSdS(NRR?R@(RRR	(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRbs
(R$R%R*RRRR(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR>Ist
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�ZRS(cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tgetRRBR
RCtclientR/twantR+thaveR:tchanges(R#targstkwargs((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyt__init__ls
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRC(RR(R1RFRR:RH(R#tchangedtkey((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyt_set_changed_optionssscC`s�i}xitjD]^}t|j|�dk	rt|j|�}t|j|�}||krn|||<qnqqW|r�td|�|_tSt	S(NRC(
RR)R1RFRRGR:RHR-R.(R#RLRMtattr1tattr2((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyt_update_changed_options{scC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(NRRR(tpopRBt	deprecate(R#R6twarningstwarning((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyt_announce_deprecations�s


cC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRCRL(R.R!RFtstateRWRXR>RHR9R3RV(R#RLR6RYt
reportableRH((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pytexec_module�s	

cC`s$|j�r|j�S|j�SdS(N(texistsR3tcreate(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRW�s
cC`s|j�}|rtStS(N(RQR-R.(R#R6((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyt
should_update�scC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRGR^R.RBt
check_modeR-tupdate_on_device(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR3�s
cC`sC|jjrtS|j�|j�|j�r?td��ntS(Ns!Failed to delete the device group(RBR`R-t#remove_members_in_group_from_devicetremove_from_deviceR\R(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pytremove�s

cC`s[|j�|jjdkr=|jjdk	r=td��n|jjrMtS|j	�tS(Ns	sync-onlysH'network_failover' may only be specified when 'type' is 'sync-failover'.(
RNRFRRRRRBR`R-tcreate_on_device(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR]�s
$
cC`s|j�r|j�StS(N(R\RdR.(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRX�s
cC`s�dj|jjd|jjd|jj�}|jjj|�}y|j�}Wntk
rht	SX|j
dks�d|kr�|ddkr�t	StS(Ns+https://{0}:{1}/mgmt/tm/cm/device-group/{2}tservertserver_porti�tcode(tformatREtproviderRFtnametapiRDtjsont
ValueErrorR.RR-(R#turitresptresponse((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR\�s


+cC`s0dj|jjd|jjd|jj�}|jjj|�}y|j�}Wn%tk
r{}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��nx`|dD]T}|dj|d	�}|jjj|�}|j
d
krtSt	|j��q�WdS(Ns4https://{0}:{1}/mgmt/tm/cm/device-group/{2}/devices/RfRgRhi�tmessagetitemss{0}Rki�(RiRERjRFRkRlRDRmRnRtstrtcontenttdeleteRR-(R#RoRpRqtextitemtnew_uri((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRb�s&

cC`s�|jj�}|jj|d<|jj|d<dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j��n|dS(
NRkt	partitions(https://{0}:{1}/mgmt/tm/cm/device-group/RfRgRmRhi�i�RrtselfLink(i�i�(RHt
api_paramsRFRkRzRiRERjRltpostRmRnRRtRu(R#RCRoRpRqRw((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRe�s 
cC`s�|jj�}dj|jjd|jjd|jj�}|jjj|d|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ndS(Ns+https://{0}:{1}/mgmt/tm/cm/device-group/{2}RfRgRmRhi�Rr(RHR|RiRERjRFRkRltpatchRmRnRRtRu(R#RCRoRpRqRw((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRas

cC`sjdj|jjd|jjd|jj�}|jjj|�}|jdkrWtSt	|j
��dS(Ns+https://{0}:{1}/mgmt/tm/cm/device-group/{2}RfRgi�(RiRERjRFRkRlRvRR-RRu(R#RoRq((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRcs

cC`s�dj|jjd|jjd|jj�}|jjj|�}y|j�}Wn%tk
r{}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��ntd|�S(Ns+https://{0}:{1}/mgmt/tm/cm/device-group/{2}RfRgRhi�RrRC(
RiRERjRFRkRlRDRmRnRRtRuR+(R#RoRpRqRw((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR_*s

(R$R%RKRNRQRVR[RWR^R3RdR]RXR\RbReRaRcR_(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRAks"			
															tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdddg�dt�dtdddd	�d
tdd�dtdd�dtd
t�dtdd�dtdddddg�dtdd��	}i|_|jjt�|jj|�dS(NRtchoicess
sync-failovers	sync-onlyRRtbooltdefaultR@RRRktrequiredRR"RYRWRXR(R-tsupports_check_modeR!t
argument_specR3R
(R#R�((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyRK?s.								(R$R%RK(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyR>scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RBR(
RRR�R�RAR[t	exit_jsonRt	fail_jsonRt(tspecRBtmmtresultsRw((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pytmainas		t__main__N("t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt)ansible.module_utils.parsing.convert_boolR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
tImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRR+R/R0R:R>tobjectRARR�R$(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_group.pyt<module>s<


_&
5$$"�#	

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