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

�
�Udac@`s#ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZydddlm
Z
dd
lmZddlmZddlmZddlmZddlmZWnqek
r9ddlm
Z
dd
lmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd efd!��YZd"efd#��YZ d$�Z!e"d%kre!�nd&S('i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatust	certifiedtsupported_bys�
---
module: bigip_device_ntp
short_description: Manage NTP servers on a BIG-IP
description:
  - Manage NTP servers on a BIG-IP.
version_added: 2.2
options:
  ntp_servers:
    description:
      - A list of NTP servers to set on the device. At least one of C(ntp_servers)
        or C(timezone) is required.
    type: list
  state:
    description:
      - The state of the NTP servers on the system. When C(present), guarantees
        that the NTP servers are set on the system. When C(absent), removes the
        specified NTP servers from the device configuration.
    type: str
    choices:
      - absent
      - present
    default: present
  timezone:
    description:
      - The timezone to set for NTP lookups. At least one of C(ntp_servers) or
        C(timezone) is required.
    type: str
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
sx
- name: Set NTP server
  bigip_device_ntp:
    ntp_servers:
      - 192.0.2.23
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Set timezone
  bigip_device_ntp:
    timezone: America/Los_Angeles
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s
ntp_servers:
  description: The NTP servers that were set on the device
  returned: changed
  type: list
  sample: ["192.0.2.23", "192.0.2.42"]
timezone:
  description: The timezone that was set on the device
  returned: changed
  type: str
  sample: true
(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(t
is_empty_listt
ParameterscB`sBeZidd6ZddgZddgZddgZdgZRS(tntp_serverstserversttimezone(t__name__t
__module__tapi_maptapi_attributest
updatablestreturnablestabsentables(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyRes
t
ApiParameterscB`seZRS((RR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR{stModuleParameterscB`seZed��ZRS(cC`s1|jd}|dkrdSt|�r-gS|S(NR(t_valuestNoneR(tselfR((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR�s
(RRtpropertyR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyRstChangescB`seZd�ZRS(cC`s}i}y_xI|jD]>}t||�}t|t�rG|j|�q|||<qW|j|�}Wntk
rxnX|S(N(Rtgetattrt
isinstancetdicttupdatet_filter_paramst	Exception(Rtresultt
returnabletchange((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyt	to_return�s
(RRR*(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR �st
UsableChangescB`seZRS((RR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR+�stReportableChangescB`seZRS((RR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR,�st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(RR.R/((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R!tAttributeErrort_Difference__default(RtparamR'((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R!R.R/R1(RR3tattr1tattr2((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyt	__default�s
cC`sS|jj}|jjdkr"dS|dkr�|jjdkrP|jjrPdSt|jj�t|jj�krxgSt|jj�t|jj�kr�tt|jj�j|jj��Sn|jjs|jjdkr�dS|jjdk	r|jjSn|jjdkr!|jjSt|jj�t|jj�krO|jjSdS(Ntabsent(R.tstateRRR/tsettlistt
difference(RR9((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR�s&$$(

$N(RRRR0R4R2RR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR-�s			t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�ZRS(cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tpopRR>R	R?tclientRR.RR/R+tchanges(Rtargstkwargs((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR0�s
cC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(Nt
__warningstmsgtversion(R@R>t	deprecate(RR'twarningstwarning((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyt_announce_deprecations�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(NR?(R-R.R/RRR#R4RR"R$R+RBtTruetFalse(RtdiffRtchangedtkR)((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyt_update_changed_options�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(NR?(R-R.R/RRR#R4RR"R$R+RBRLRM(RRNRRORPR)((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyt_absent_changed_options�s		
cC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j|�|j	j
r�|jr�|j�|d<n|jtd|��|j
|�|S(NtpresentR8R?RNRO(RMR#R.R9R$R8R,RBR*R>t_diffR/t	make_diffRK(RROR'R9t
reportableRB((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pytexec_modules	

cC`sRt�}tj}x9|D]1}t||�dk	rt||�||<qqW|S(N(R#RRR!R(RtitemR'RRP((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyt
_grab_attrs		
cC`s1td|j|j�d|j|j��}|S(Ntbeforetafter(R#RYR/R.(RR'((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyRU s-cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR/t
should_updateRMR>t
check_modeRLtupdate_on_device(R((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR$$s
cC`s|j�}|rtStS(N(RQRLRM(RR'((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR]-scC`s|j�}|rtStS(N(RRRLRM(RR'((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyt
should_absent3scC`s=|j�|_|j�stS|jjr/tS|j�tS(N(R\R/R`RMR>R^RLtabsent_on_device(R((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR89s
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��ndS(Ns https://{0}:{1}/mgmt/tm/sys/ntp/tservertserver_porttjsontcodei�tmessage(RBt
api_paramstformatRAtprovidertapitpatchRdt
ValueErrorR
tstrtcontent(RR?turitresptresponsetex((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR_Bs
cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��nt
d|�S(Ns https://{0}:{1}/mgmt/tm/sys/ntp/RbRcRei�RfR?(RhRARiRjtgetRdRlR
RmRnR(RRoRpRqRr((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR\Ts
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��ndS(Ns https://{0}:{1}/mgmt/tm/sys/ntp/RbRcRdRei�Rf(RBRgRhRARiRjRkRdRlR
RmRn(RR?RoRpRqRr((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyRafs
(RRR0RKRQRRRWRYRUR$R]R`R8R_R\Ra(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR=�s															tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdd�dt�dtddddd	g��}i|_|jjt�|jj|�ddgg|_dS(
NRttypeR;RR9tdefaultRStchoicesR8(RLtsupports_check_modeR#t
argument_specR$R
trequired_one_of(RRy((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyR0zs				(RRR0(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyRtyscC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NRyRxRzR>RF(RtRRyRxRzR=RWt	exit_jsonR
t	fail_jsonRm(tspecR>tmmtresultsRr((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pytmain�s			t__main__N(#t
__future__RRRRut
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt%library.module_utils.network.f5.bigipR	t&library.module_utils.network.f5.commonR
RRR
RtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRRRR R+R,tobjectR-R=RtR�R(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_ntp.pyt<module>sD


"

,�	

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