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/bigiq_device_discovery.pyo

�
�Udac@`s_ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZytddlmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
ruddlmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZ defd��YZ!defd��YZ"de"fd��YZ#de"fd ��YZ$d!e%fd"��YZ&d#e%fd$��YZ'd%e%fd&��YZ(d'�Z)e*d(kr[e)�ndS()i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigiq_device_discovery
short_description: Manage BIG-IP devices through BIG-IQ
description:
  - Discovers and imports BIG-IP device configuration on the BIG-IQ.
version_added: 2.8
options:
  device_address:
    description:
      - The IP address of the BIG-IP device to be imported/managed.
    type: str
    required: True
  device_username:
    description:
      - The administrator username for the BIG-IP device.
      - This parameter is only required when adding a new BIG-IP device to be managed.
    type: str
  device_password:
    description:
      - The administrator password for the BIG-IP device.
      - This parameter is only required when adding a new BIG-IP device to be managed.
    type: str
  device_port:
    description:
      - The port on which a device trust setup between BIG-IQ and BIG-IP should happen.
    type: int
    default: 443
  ha_name:
    description:
      - DSC cluster name of the BIG-IP device to be managed.
      - This is optional if the managed device is not a part of a cluster group.
      - When C(use_bigiq_sync) is set to C(yes) then this parameter becomes mandatory.
    type: str
  use_bigiq_sync:
    description:
      - When set to true, BIG-IQ will manually synchronize configuration changes
        between members in a DSC cluster.
    type: bool
    default: no
  conflict_policy:
    description:
      - Sets the conflict resolution policy for shared objects across BIG-IP devices, except LTM profiles and monitors.
    type: str
    choices:
      - use_bigiq
      - use_bigip
    default: use_bigiq
  versioned_conflict_policy:
    description:
      - Sets the conflict resolution policy for LTM profile and monitor objects that are specific to a BIG-IP software
        version.
    type: str
    choices:
      - use_bigiq
      - use_bigip
      - keep_version
  device_conflict_policy:
    description:
      - Sets the conflict resolution policy for objects that are specific to a particular to a BIG-IP device
        and not shared among BIG-IP devices.
    type: str
    choices:
      - use_bigiq
      - use_bigip
    default: use_bigiq
  access_conflict_policy:
    description:
      - Sets the conflict resolution policy for Access module C(apm) objects, only used when C(apm) module is specified.
    type: str
    choices:
      - use_bigiq
      - use_bigip
      - keep_version
  access_group_name:
    description:
      - Access group name to import Access configuration for devices, once set it cannot be changed.
    type: str
  access_group_first_device:
    description:
      - Specifies if the imported device is the first device in the access group to import shared configuration for that
        access group.
    type: bool
    default: yes
  force:
    description:
      - Forces rediscovery and import of existing modules on the managed BIG-IP
    type: bool
    default: no
  modules:
    description:
      - List of modules to be discovered and imported into the device.
      - These modules must be provisioned on the target device otherwise operation will fail.
      - The C(ltm) module must always be specified when performing discovery or re-discovery of the the device.
      - When C(asm) or C(afm) are specified C(shared_security) module needs to also be declared.
    type: list
    choices:
      - ltm
      - asm
      - apm
      - afm
      - dns
      - websafe
      - security_shared
  statistics:
    description:
      - Specify the statistics collection for discovered device.
    type: dict
    suboptions:
      enable:
        description:
          - Enables statistics collection on a device
        type: bool
        default: no
      interval:
        description:
          - Specify the interval in seconds the data is collected from the discovered device.
        type: int
        default: 60
        choices:
          - 30
          - 60
          - 120
          - 500
      zone:
        description:
          - Specify in which DCD zone is collecting the data from device.
        type: str
        default: default
      stat_modules:
        description:
          - Specifies for which modules the data is being collected.
        type: list
        default: ['device', 'ltm']
        choices:
          - device
          - ltm
          - dns
  state:
    description:
      - The state of the managed device on the system.
      - When C(present), enables new device addition as well as device rediscovery/import.
      - When C(absent), completely removes the device from the system.
    type: str
    choices:
      - absent
      - present
    default: present
extends_documentation_fragment: f5
notes:
  - BIG-IQ >= 6.1.0.
  - This module does not support atomic removal of discovered modules on the device.
author:
  - Wojciech Wypior (@wojtek0806)
s�
- name: Discover a new device and import config, use default conflict policy.
  bigiq_device_discovery:
    device_address: 192.168.1.1
    device_username: bigipadmin
    device_password: bigipsecret
    modules:
      - ltm
      - afm
      - shared_security
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Discover a new device and import config, use non- default conflict policy.
  bigiq_device_discovery:
    device_address: 192.168.1.1
    modules:
      - ltm
      - dns
    conflict_policy: use_bigip
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Force full device rediscovery
  bigiq_device_discovery:
    device_address: 192.168.1.1
    modules:
      - ltm
      - afm
      - dns
      - shared_security
    force: yes
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove discovered device and its config
  bigiq_device_discovery:
    device_address: 192.168.1.1
    state: absent
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
device_address:
  description: The IP address of the BIG-IP device to be imported/managed.
  returned: changed
  type: str
  sample: 192.168.1.1
device_port:
  description: The port on which a device trust setup between BIG-IQ and BIG-IP should happen.
  returned: changed
  type: int
  sample: 10443
ha_name:
  description: DSC cluster name of the BIG-IP device to be managed.
  returned: changed
  type: str
  sample: GROUP_1
use_bigiq_sync:
  description: Indicate if BIG-IQ should manually synchronise DSC configuration.
  returned: changed
  type: bool
  sample: yes
conflict_policy:
  description: Sets the conflict resolution policy for shared objects across BIG-IP devices.
  returned: changed
  type: str
  sample: use_bigip
device_conflict_policy:
  description: Sets the conflict resolution policy for objects that are specific to a particular to a BIG-IP device.
  returned: changed
  type: str
  sample: use_bigip
versioned_conflict_policy:
  description: Sets the conflict resolution policy for LTM profile and monitor objects.
  returned: changed
  type: str
  sample: keep_version
access_conflict_policy:
  description: Sets the conflict resolution policy for Access module C(apm) objects.
  returned: changed
  type: str
  sample: keep_version
access_group_name:
  description: Access group name to import Access configuration for devices.
  returned: changed
  type: str
  sample: foo_group
access_group_first_device:
  description: First device in the access group to import shared configuration for that access group.
  returned: changed
  type: bool
  sample: yes
modules:
  description: List of modules to be discovered and imported into the device.
  returned: changed
  type: list
  sample: ['ltm', 'dns']

N(tLooseVersion(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spec(tflatten_boolean(tis_valid_ip(t
bigiq_versiont
ParameterscB`s�eZidd6dd6dd6dd6dd	6d
d6Zddddd	dgZdddddd
dd
dddddddgZddddgZRS(tdevice_addresstaddresstdevice_usernametuserNametdevice_passwordtpasswordtdevice_portt	httpsPorttha_nametclusterNametuse_bigiq_synctuseBigiqSynctmodulestconflict_policytversioned_conflict_policytdevice_conflict_policytaccess_group_nametaccess_group_first_devicetaccess_conflict_policytmodule_listtapm_properties(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR3s@
		t
ApiParameterscB`s]eZidd6dd6dd6dd6dd	6d
d6dd
6Zed��Zed��ZRS(tsecurity_shareds#cm-security-shared-allSharedDevicestasmscm-asm-allAsmDevicestfirewallscm-firewall-allFirewallDevicestfpsscm-websafe-allFpsDevicestdnsscm-dns-allBigIpDevicestadc_corescm-adccore-allbigipDevicestaccessscm-access-allBigIpDevicescC`s�|jd}|dkrdSt�}xe|j�D]W}||jkr3||dtkr�||dtkr�|j|j|�q�q3q3W|S(Nt
propertiest
discoveredtimported(t_valuestNonetlisttkeyst
module_maptTruetappend(tselftraw_datatresulttitem((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRks
	(cC`sT|jd}|dkrdSx0|j�D]"}d||kr*||dSq*WdS(NR5scm:access:access-group-name(R8R9R;(R?R@RB((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR"ws
(R'R(R<tpropertyRR"(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR-`s
tModuleParameterscB`seZidd6dd6dd6dd6Zed��Zed	��Zed
��Zed��Zed��Zed
��Z	ed��Z
ed��Zed��Zed��Z
ed��Zed��Zed��Zed��Zed��Zed��ZRS(R3tltmR0tafmR1twebsafeR4tapmcC`s"|jddkrdS|jdS(NR(R8R9(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�scC`s"|jddkrdS|jdS(NR(R8R9(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�scC`s>t|jd�r|jdStdj|jd���dS(NRs/Provided device address: {0} is not a valid IP.(RR8Rtformat(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�scC`s(|jddkrdSt|jd�S(NR(R8R9tint(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�scC`s|jdj�S(NR(R8tupper(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�scC`s|jdj�S(NR!(R8RK(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR!�scC`s(|jddkrdS|jdj�S(NR (R8R9RK(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR �scC`s(|jddkrdS|jdj�S(NR$R!(R8R9RK(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR$�scC`s$|jddkrdSt�}d|jdkrzd|jdkrUtd��nd|jdkrztd��qznd|jdkr�td��nd	|jdkr�|js�|jr�td
��q�nxH|jdD]9}||jkr|j|j|�q�|j|�q�W|S(NRR.RFs3Module 'shared_security' required for 'afm' module.R/s3Module 'shared_security' required for 'asm' module.REs=LTM module must be specified for device discovery and import.RHsVWhen importing APM 'access_group_name' and 'access_conflict_policy' must be specified.(R8R9R:RR"R$R<R>(R?RARB((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�s,	cC`sV|jddkrdSd|jdkrRi|jd6|jd6|jd6}|SdS(NRRHscm:access:conflict-resolutionscm:access:access-group-namescm:access:import-shared(R8R9R$R"R#(R?RA((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR&�s


cC`s1t|jd�}|r-|dkr)tStSdS(NRtyes(RR8R=tFalse(R?RA((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�s
cC`s1t|jd�}|r-|dkr)tStSdS(NR#RL(RR8R=RM(R?RA((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR#�s
cC`sL|jddkrdSt|jdd�}|rH|dkrDtStSdS(Nt
statisticstenableRL(R8R9RR=RM(R?RA((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyt
stats_enabled�scC`s&|jddkrdS|jddS(NRNtinterval(R8R9(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRQ�scC`s&|jddkrdS|jddS(NRNtzone(R8R9(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRRscC`sb|jddkrdS|jdd}t�}x*|D]"}|jtd|j���q8W|S(NRNtstat_modulestmodule(R8R9R:R>tdictRK(R?RRART((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRSs	
 (R'R(R<RCRRRRRR!R R$RR&RR#RPRQRRRS(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRD�s*

tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R+tgetattrt_filter_paramst	Exception(R?RAt
returnable((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyt	to_returns
(R'R(R[(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRVst
UsableChangescB`s&eZed��Zed��ZRS(cC`sR|jddkrdSt�}x+|jdD]}|jtd|��q.W|S(NRRT(R8R9R:R>RU(R?RARB((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR s	cC`s�|jddkrdSt�}x]|jdD]N}|dkrf|jtd|d|jd��q.|jtd|��q.W|S(NRR4RTR5R&(R8R9R:R>RU(R?RARB((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR%)s	&(R'R(RCRR%(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR\s	tReportableChangescB`s&eZed��Zed��ZRS(cC`sdS(N(R9(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR%7scC`sdS(N(R9(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR&;s(R'R(RCR%R&(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR]6st
DifferencecB`sSeZdd�Zd�Zd�Zed��Zed��Zed��Z	RS(cC`s||_||_dS(N(twantthave(R?R_R`((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyt__init__As	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RWtAttributeErrort_Difference__default(R?tparamRA((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pytcompareEs

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RWR_R`Rb(R?Rdtattr1tattr2((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyt	__defaultLs
cC`s�|jjdkrdS|jjdkr2|jjSt|jj�j|jj�rWdSt|jj�t|jj�kr�|jjSdS(N(R_RR9R`tsettissubset(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRUs
!$cC`s+|jj|jjkr'td��ndS(Ns4Access group name cannot be modified once it is set.(R_R"R`R(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR"`scC`sdS(N(R9(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR&gsN(
R'R(R9RaReRcRCRR"R&(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR^@s			t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cO`sp|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_d|_d|_
dS(NRTtparams(tgetR9RTR
RltclientRDR_R-R`R\tchangest	device_idttask_id(R?targstkwargs((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRans	cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRl(RR+RWR_R9R\Ro(R?tchangedtkey((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyt_set_changed_optionswscC`s�t|j|j�}tj}t�}xX|D]P}|j|�}|dkrUq.q.t|t�rt|j	|�q.|||<q.W|r�|jj
|d<td|�|_t
StS(NR&Rl(R^R_R`RR,RUReR9t
isinstancetupdateR&R\RoR=RM(R?tdiffR,Rttktchange((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyt_update_changed_optionss		
cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRnRTt	deprecate(R?RAtwarningstwarning((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyt_announce_deprecations�s


cC`s:t|j�}t|�td�kr6td��ndS(Ns6.1.0s3Module supports only BIGIQ version 6.1.x or higher.(RRnRR(R?R((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pytcheck_bigiq_version�scC`s�|j�t}t�}|jj}|dkr@|j�}n|dkr[|j�}ntd|jj	��}|j	�}|j
|�|j
td|��|j|�|S(NtpresenttabsentRlRt(R�RMRUR_tstateR�R�R]RoR[RxR�(R?RtRAR�t
reportableRo((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pytexec_module�s
	

cC`s$|j�r|j�S|j�SdS(N(texistsRxtcreate(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR��s
cC`s|j�r|j�StS(N(R�tremoveRM(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR��s
cC`s|j�}|rtStS(N(R|R=RM(R?RA((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyt
should_update�scC`s�|j�|_|j�r-|jjr-tS|jjr=tS|jjrV|j	�n|j
�|j�|jjr�|j
�ntS(N(tread_current_from_deviceR`R�R_tforceRMRTt
check_modeR=Rvtdiscover_on_devicetimport_modules_on_deviceRPtenable_stats_on_device(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRx�s



cC`s(|jjrtS|j�|j�tS(N(RTR�R=tremove_autority_from_devicetremove_trust_from_device(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR��s


cC`sv|jjdkr!td��n|j�|jjr;tS|j�|j	�|j
�|jjrr|j�ntS(Ns8List of modules cannot be empty if discovering a device.(
R_RR9RRvRTR�R=tset_trust_with_deviceR�R�RPR�(R?((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR��s




cC`s�dj|jjd|jjd�}dj|jj�}|jjj||�}y|j�}Wntk
rxt	SX|j
dks�d|kr�|ddkr�t|j��nd|kr�|ds�t	S|ddd	|_
tSt	S(
Ns1https://{0}:{1}/mgmt/cm/system/machineid-resolvertservertserver_ports?$filter=address eq '{0}'i�tcodetitemsit	machineId(RIRntproviderR_RtapiRmtjsont
ValueErrorRMRRtmessageRpR=(R?turitquerytresptresponse((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR��s"

+
cC`sH|jj�}dj|jj�|d<dj|jjd|jjd�}|jjj|d|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j
��ndj|jjd|jjd|d�}d
}|j||�rD|j|�ntS(Ns	trust_{0}tnames2https://{0}:{1}/mgmt/cm/global/tasks/device-trust/R�R�R�R�i�i�R�s5https://{0}:{1}/mgmt/cm/global/tasks/device-trust/{2}tids(?$select=status,currentStep,errorMessage(i�i�(Rot
api_paramsRIR_RRnR�R�tpostR�R�Rtstrtcontentt_wait_for_taskt_set_device_idR=(R?RlR�R�R�texttaskR�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�s,



cC`s�|jjj|�}y|j�}Wn%tk
rL}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j��n|d|_dS(NR�i�R�R�(	RnR�RmR�R�RR�R�Rp(R?R�R�R�R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�scC`s"x�tr�|jjj|�}y|j�}Wn%tk
rU}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j��n|ddkr�Pnt	j
d�qW|ddkr�t|d	��n|ddkr
td
��n|ddkrtSdS(NR�i�R�RtFINISHEDtFAILEDt	CANCELLEDiterrorMessages$The task process has been cancelled.(R�R�R�(R=RnR�RmR�R�RR�R�ttimetsleep(R?R�R�R�R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�.s(	c	
C`s�|jj�}|jd�r�td|ddd�}dj|jjd|jjd|j�}|jjj	|d	|�}n�td
dj|j
j�d|ddtd
dj|j��dd�}dj|jjd|jjd�}|jjj
|d	|�}y|j�}Wn%tk
rB}tt|���nXd|kr�|ddkr�d|kr~t|d��q�t|j��ndj|jjd|jjd|d�}d}|j||�tS(Nt	discoveryt
moduleListRRtSTARTEDs9https://{0}:{1}/mgmt/cm/global/tasks/device-discovery/{2}R�R�R�R�s
discovery_{0}tdeviceReferencetlinks7https://localhost/mgmt/cm/system/machineid-resolver/{0}s5https://{0}:{1}/mgmt/cm/global/tasks/device-discoveryR�i�i�R�R�s(?$select=status,currentStep,errorMessage(i�i�(RoR[treuse_task_on_deviceRURIRnR�RqR�tpatchR_RRpR�R�R�RR�R�R�R=(	R?ttmpRlR�R�R�R�R�R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�KsF
	


	



c	C`sF|jj�}|jd�r�td|dd|jjd|jjdd�}|jjrn|jj|d<nd	j|j	j
d
|j	j
d|j�}|j	jj
|d|�}n�td
dj|jj�d|dd|jjd|jjdtddj|j��dd�}|jjr8|jj|d<ndj|j	j
d
|j	j
d�}|j	jj|d|�}y|j�}Wn%tk
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j��nd	j|j	j
d
|j	j
d|d�}d}|j||�tS(NtimportR�R%tconflictPolicytdeviceConflictPolicyRR�tversionedConflictPolicys6https://{0}:{1}/mgmt/cm/global/tasks/device-import/{2}R�R�R�R�s
import_{0}R�R�s7https://localhost/mgmt/cm/system/machineid-resolver/{0}s2https://{0}:{1}/mgmt/cm/global/tasks/device-importR�i�i�R�R�s(?$select=status,currentStep,errorMessage(i�i�(RoR[R�RUR_RR!R RIRnR�RqR�R�RRpR�R�R�RR�R�R�R=(	R?R�RlR�R�R�R�R�R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�sV
	


	



cC`sbtd|jjd|jjd|jjd|jjdtddj|j���}dj|jj	d	|jj	d
�}|jj
j|d|�}y|j�}Wn%t
k
r�}tt|���nXd|kr|ddkrd|krt|d��qt|j��ndj|jj	d	|jj	d
|d�}d}|j||�tS(NtenabledtpushIntervalSecsRRRttargetDeviceReferenceR�s7https://localhost/mgmt/cm/system/machineid-resolver/{0}sGhttps://{0}:{1}/mgmt/cm/shared/stats-mgmt/agent-install-and-config-taskR�R�R�R�i�i�R�sKhttps://{0}:{1}/mgmt/cm/shared/stats-mgmt/agent-install-and-config-task/{2}R�s(?$select=status,currentStep,errorMessage(i�i�(RUR_RPRQRRRSRIRpRnR�R�R�R�R�RR�R�R�R=(R?RlR�R�R�R�R�R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR��s6



cC`s9|dkr5dj|jjd|jjd�}n&dj|jjd|jjd�}dj|j�}|jjj||�}y|j�}Wn%tk
r�}tt	|���nXd|kr|dd
krd
|kr�t|d
��qt|j
��nd|kr5|dr5|d|_tSnt
S(NR�s5https://{0}:{1}/mgmt/cm/global/tasks/device-discoveryR�R�s2https://{0}:{1}/mgmt/cm/global/tasks/device-imports&?$filter=deviceReference/link eq '{0}'R�i�i�R�R�R�(i�i�(RIRnR�RpR�RmR�R�RR�R�RqR=RM(R?R�R�R�R�R�R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR��s,



c		C`s�idd6idd6idd6idd6idd6idd6idd6g}td	|d
tddj|j��d
dj|jj��}dj|jjd|jjd�}|jjj|d|�}y|j	�}Wn%t
k
r}tt|���nXd|krQ|ddkrQd|kr?t|d��qQt|j
��ndj|jjd|jjd|d�}d}|j||�dS(NR3RTR4R/R1R0R.R2R�R�R�s7https://localhost/mgmt/cm/system/machineid-resolver/{0}R�sremove_auth_{0}sBhttps://{0}:{1}/mgmt/cm/global/tasks/device-remove-mgmt-authority/R�R�R�R�i�i�R�sEhttps://{0}:{1}/mgmt/cm/global/tasks/device-remove-mgmt-authority/{2}R�s(?$select=status,currentStep,errorMessage(i�i�(RURIRpR_RRnR�R�R�R�R�RR�R�R�(	R?RRlR�R�R�R�R�R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�s<









cC`sGtdtddj|j��ddj|jj��}dj|jjd|jjd�}|jjj|d	|�}y|j	�}Wn%t
k
r�}tt|���nXd
|kr�|d
dkr�d
|kr�t|d
��q�t|j
��ndj|jjd|jjd|d�}d}|j||�dS(NR�R�s7https://localhost/mgmt/cm/system/machineid-resolver/{0}R�sremove_auth_{0}s9https://{0}:{1}/mgmt/cm/global/tasks/device-remove-trust/R�R�R�R�i�i�R�s<https://{0}:{1}/mgmt/cm/global/tasks/device-remove-trust/{2}R�s(?$select=status,currentStep,errorMessage(i�i�(RURIRpR_RRnR�R�R�R�R�RR�R�R�(R?RlR�R�R�R�R�R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�4s,



cC`s�dj|jjd|jjd|j�}|jjj|�}y|j�}Wn%tk
rx}tt	|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ntd|�S(Ns5https://{0}:{1}/mgmt/cm/system/machineid-resolver/{2}R�R�R�i�R�Rl(RIRnR�RpR�RmR�R�RR�R�R-(R?R�R�R�R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�Vs

(R'R(RaRvR|R�R�R�R�R�R�RxR�R�R�R�R�R�R�R�R�R�R�R�R�(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRkms.																		4	@	)		-	"tArgumentSpeccB`seZd�ZRS(c2C`s3t|_ddg|_tdtdt�dtdt�dtdt�dtd	d
dd�d
t�dtd	ddd�dtd|jdd�dtd|jdg�dtd|jdd�dtd	ddd�dtd	dddddddddg�d td|jdg�d!t�d"td	ddd#�d$td	d%d&td'td	ddd�d(td	d
dd)d*d+d,gdd*�d-td	d.dd�d/td	ddd0ddgdd0dg���d1tdd2dd3d2g��}dtd
ggg|_i|_|jjt�|jj|�dS(4Nt	use_bigipt	use_bigiqRtrequiredRtno_logRRttypeRJtdefaulti�RRtbooltnoRtchoicesR tkeep_versionR!R�RR:RER/RFR2RGR.RHR$R"R#RLRNRUtoptionsRORQii<ixi�RRR�RStdeviceR�R�R�(R=tsupports_check_modetconflictRUtrequired_ift
argument_specRxR
(R?R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyRakst																		(R'R(Ra(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyR�jscC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�R�R�RTR~(R�R	R�R�R�RkR�t	exit_jsonRt	fail_jsonR�(tspecRTtmmtresultsR�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pytmain�s			t__main__(+t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR�tdistutils.versionRtansible.module_utils.basicR	t%library.module_utils.network.f5.bigiqR
t&library.module_utils.network.f5.commonRRR
Rt)library.module_utils.network.f5.ipaddressRt(library.module_utils.network.f5.icontrolRtImportErrort%ansible.module_utils.network.f5.bigiqt&ansible.module_utils.network.f5.commont)ansible.module_utils.network.f5.ipaddresst(ansible.module_utils.network.f5.icontrolRR-RDRVR\R]tobjectR^RkR�R�R'(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_device_discovery.pyt<module>sN


�7;
-"�
-��\	

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