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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZyDddlm
Z
dd
lmZddlmZddlmZWnQek
r�ddlm
Z
dd
lmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd efd!��YZd"�Ze d#kr�e�nd$S(%i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatust	certifiedtsupported_bys�
---
module: bigip_hostname
short_description: Manage the hostname of a BIG-IP
description:
  - Manage the hostname of a BIG-IP.
version_added: 2.3
options:
  hostname:
    description:
      - Hostname of the BIG-IP host.
    type: str
    required: True
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Matthew Lam (@mryanlam)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Set the hostname of the BIG-IP
  bigip_hostname:
    hostname: bigip.localhost.localdomain
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost
su
hostname:
  description: The new hostname of the device
  returned: changed
  type: str
  sample: big-ip01.internal
(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spect
ParameterscB`s;eZdgZdgZdgZd�Zed��ZRS(thostnamecC`s@i}x$|jD]}t||�||<qW|j|�}|S(N(treturnablestgetattrt_filter_params(tselftresultt
returnable((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyt	to_returnIs
cC`s(|jddkrdSt|jd�S(NR(t_valuestNonetstr(R((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyRPs(t__name__t
__module__tapi_attributest
updatablesRRtpropertyR(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR
Ds
				t
ApiParameterscB`seZRS((RR(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyRWstModuleParameterscB`seZRS((RR(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR[stChangescB`seZRS((RR(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR _st
UsableChangescB`seZRS((RR(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR!cstReportableChangescB`seZRS((RR(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR"gst
DifferencecB`s&eZdd�Zd�Zd�ZRS(cC`s||_||_dS(N(twantthave(RR$R%((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyt__init__ls	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RtAttributeErrort_Difference__default(RtparamR((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pytcompareps

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RR$R%R'(RR)tattr1tattr2((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyt	__defaultws
N(RRRR&R*R((((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR#ks	t
ModuleManagercB`sbeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
cO`s^|jdd�|_t|jj�|_t�|_td|jj�|_	t
�|_dS(Ntmoduletparams(tgetRR/R	R0tclientRR%RR$R!tchanges(Rtargstkwargs((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR&�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR0(R
RRR$RR!R3(Rtchangedtkey((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyt_set_changed_options�scC`s�t|j|j�}tj}t�}x9|D]1}|j|�}|dkrUq.q.|||<q.W|rtd|�|_	t
StS(NR0(R#R$R%R
RtdictR*RR!R3tTruetFalse(RtdiffRR6tktchange((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyt_update_changed_options�s		
cC`smt�}|j�}td|jj��}|j�}|j|�|jtd|��|j|�|S(NR0R6(R9tupdateR"R3Rt_announce_deprecations(RRR6t
reportableR3((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pytexec_module�s	

cC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR/t	deprecate(RRtwarningstwarning((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyRA�s


cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��n|S(Ns,https://{0}:{1}/mgmt/tm/sys/global-settings/tservertserver_porttcodei�tmessage(
tformatR2tprovidertapiR1tjsont
ValueErrorR
Rtcontent(Rturitresptresponsetex((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyt!_read_global_settings_from_device�s
cC`s|j�}dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
r~}tt	|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ntd�|dD�d�}||d	<t
d
|�S(Ns"https://{0}:{1}/mgmt/tm/cm/device/RKRLRMi�RNcs`s)|]}|ddkr|dVqdS(t
selfDevicettruetnameN((t.0tx((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pys	<genexpr>�stitemstself_deviceR0(RYROR2RPRQR1RRRSR
RRTtnextRR(RRRURVRWRXR`((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pytread_current_from_device�s 

cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(RbR%t
should_updateR;R/t
check_modeR:tupdate_on_device(R((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR@�s
cC`s|j�}|rtStS(N(R?R:R;(RR((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyRc�scC`s�|jj�}dj|jjd|jjd�}|jjj|d|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��n|jj
r�dj|jjd|jjd�}td	d
d|jj
d|jj�}|jjj|d|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��q�ndS(
Ns,https://{0}:{1}/mgmt/tm/sys/global-settings/RKRLRRRMi�RNs!https://{0}:{1}/mgmt/tm/cm/devicetcommandtmvR\ttarget(R$t
api_paramsROR2RPRQtpatchRRRSR
RRTR%R`R9Rtpost(RR0RURVRWRXR4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyRe�s<

(RRR&R8R?RCRARYRbR@RcRe(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR.�s										tArgumentSpeccB`seZd�ZRS(cC`sNt|_tdtdt��}i|_|jjt�|jj|�dS(NRtrequired(R:tsupports_check_modeR9t
argument_specR@R(RRo((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyR&s		(RRR&(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyRlscC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NRoRnR/RE(
RlRRoRnR.RCt	exit_jsonR
t	fail_jsonR(tspecR/tmmtresultsRX((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pytmain#s		t__main__N(!t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt%library.module_utils.network.f5.bigipR	t&library.module_utils.network.f5.commonR
RRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonR
RRR R!R"tobjectR#R.RlRuR(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_hostname.pyt<module>s<



�
	

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