Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/system/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/system/timezone.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZmZmZdd
lmZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd�Ze dkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: timezone
short_description: Configure timezone setting
description:
  - This module configures the timezone setting, both of the system clock and of the hardware clock. If you want to set up the NTP, use M(service) module.
  - It is recommended to restart C(crond) after changing the timezone, otherwise the jobs may run at the wrong time.
  - Several different tools are used depending on the OS/Distribution involved.
    For Linux it can use C(timedatectl) or edit C(/etc/sysconfig/clock) or C(/etc/timezone) and C(hwclock).
    On SmartOS, C(sm-set-timezone), for macOS, C(systemsetup), for BSD, C(/etc/localtime) is modified.
    On AIX, C(chtz) is used.
  - As of Ansible 2.3 support was added for SmartOS and BSDs.
  - As of Ansible 2.4 support was added for macOS.
  - As of Ansible 2.9 support was added for AIX 6.1+
  - Windows and HPUX are not supported, please let us know if you find any other OS/distro in which this fails.
version_added: "2.2"
options:
  name:
    description:
      - Name of the timezone for the system clock.
      - Default is to keep current setting.
      - B(At least one of name and hwclock are required.)
    type: str
  hwclock:
    description:
      - Whether the hardware clock is in UTC or in local timezone.
      - Default is to keep current setting.
      - Note that this option is recommended not to change and may fail
        to configure, especially on virtual environments such as AWS.
      - B(At least one of name and hwclock are required.)
      - I(Only used on Linux.)
    type: str
    aliases: [ rtc ]
    choices: [ local, UTC ]
notes:
  - On SmartOS the C(sm-set-timezone) utility (part of the smtools package) is required to set the zone timezone
  - On AIX only Olson/tz database timezones are useable (POSIX is not supported).
    - An OS reboot is also required on AIX for the new timezone setting to take effect.
author:
  - Shinichi TAMURA (@tmshn)
  - Jasper Lievisse Adriaanse (@jasperla)
  - Indrajit Raychaudhuri (@indrajitr)
s
diff:
  description: The differences about the given arguments.
  returned: success
  type: complex
  contains:
    before:
      description: The values before change
      type: dict
    after:
      description: The values after change
      type: dict
sE
- name: Set timezone to Asia/Tokyo
  timezone:
    name: Asia/Tokyo
N(t
AnsibleModuletget_platformtget_distribution(t	iteritemstTimezonecB`sneZdZd�Zd�Zd�Zd�Zddd�Zd�Zd	�Z	d
�Z
d�Zd�ZRS(
s(This is a generic Timezone manipulation class that is subclassed based on platform.

    A subclass may wish to override the following action methods:
        - get(key, phase)   ... get the value from the system at `phase`
        - set(key, value)   ... set the value to the current system
    c	C`st�dkr�|jd�}|dk	r�|j|�\}}}|dkrdttt�jt�S|jd|�ttt	�jt	�Sqttt	�jt	�Snnt
jdtj
��r<|jd�}|dk	r&|j|�\}}}|dkr&|j�dkr&|jdd	�q&nttt�jt�St
jd
tj��rjttt�jt�St
jdtj��r�ttt�jt�Stj�dkr�ttj
�tj��}|d
kr�ttt�jt�S|jdd|�nttt�jt�SdS(s�Return the platform-specific subclass.

        It does not use load_platform_subclass() because it needs to judge based
        on whether the `timedatectl` command exists and is available.

        Args:
            module: The AnsibleModule.
        tLinuxttimedatectlisEtimedatectl command was found but not usable: %s. using other method.s^joyent_.*Ztzonenametglobaltmsgs2Adjusting timezone is not supported in Global Zones^Darwins^(Free|Net|Open)BSDtAIXi=s<AIX os level must be >= 61 for timezone module (Target: %s).N(R	tget_bin_pathtNonetrun_commandtsuperRtSystemdTimezonet__new__twarntNosystemdTimezonetretmatchtplatformtversiontstript	fail_jsontSmartOSTimezonetDarwinTimezonetBSDTimezonetsystemtinttreleasetAIXTimezone(	tclstmoduleRtrctstdouttstderrtzonename_cmdt_t
AIXoslevel((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRbs4	cC`s{tt|�j�g|_t�|_xC|jD]8}|j|}|dk	r2td|�|j|<q2q2W||_	dS(sWInitialize of the class.

        Args:
            module: The AnsibleModule.
        tplannedN(
RRt__init__Rtdicttvaluet
argument_spectparamsRR)(tselfR)tkeyR3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR1�s	
cC`sad|g}t|j�dkrA|jd�|j|j�n|jjddj|��dS(s�Abort the process with error message.

        This is just the wrapper of module.fail_json().

        Args:
            msg: The error message.
        sError message:isOther message(s):Rs
N(tlenRtappendtextendR)R tjoin(R6Rt	error_msg((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pytabort�s

cO`s]dj|�}|jj|dt�\}}}|jdt�rY|jjd|�n|S(s�Execute the shell command.

        This is just the wrapper of module.run_command().

        Args:
            *commands: The command to execute.
                It will be concatenated with single space.
            **kwargs:  Only 'log' key is checked.
                If kwargs['log'] is true, record the command to self.msg.

        Returns:
            stdout: Standard output of the command.
        t tcheck_rctlogs
executed `%s`(R;R)RtTruetgettFalseRR9(R6tcommandstkwargstcommandR*R+R,((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pytexecute�s
!tbeforetaftercC`s\ii|6i|6}xAt|j�D]0\}}|||||<|||||<q$W|S(sPCalculate the difference between given 2 phases.

        Args:
            phase1, phase2: The names of phase to compare.

        Returns:
            diff: The difference of value between phase1 and phase2.
                This is in the format which can be used with the
                `--diff` option of ansible-playbook.
        (RR3(R6tphase1tphase2tdiffR7R3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRL�s
cC`sJ|dkrdSx3t|j�D]"\}}|j||�||<q WdS(s�Check the state in given phase and set it to `self.value`.

        Args:
            phase: The name of the phase to check.

        Returns:
            NO RETURN VALUE
        R0N(RR3RB(R6tphaseR7R3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pytcheck�s	cC`sOxHt|j�D]7\}}|d|dkr|j||d�qqWdS(s.Make the changes effect based on `self.value`.RHR0N(RR3tset(R6R7R3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pytchange�scC`s|jd�dS(sGet the value for the key at the given phase.

        Called from self.check().

        Args:
            key:   The key to get the value
            phase: The phase to get the value

        Return:
            value: The value for the key at the given phase.
        s5get(key, phase) is not implemented on target platformN(R=(R6R7RM((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRB�scC`s|jd�dS(s�Set the value for the key (of course, for the phase 'after').

        Called from self.change().

        Args:
            key: Key to set the value
            value: Value to set
        s5set(key, value) is not implemented on target platformN(R=(R6R7R3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRO�s	cC`sE|jdd}d|}tjj|�sA|jd|�n|S(NtnameR0s/usr/share/zoneinfo/%ss$given timezone "%s" is not available(R3tostpathtisfileR=(R6ttzttzfile((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyt_verify_timezones

(
t__name__t
__module__t__doc__RR1R=RGRLRNRPRBRORW(((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRZs	-								RcB`szeZdZedejdej�dejdej��Zedddd�Zd�Z	d�Z
d	�Zd
�ZRS(s�This is a Timezone manipulation class for systemd-powered Linux.

    It uses the `timedatectl` command to check/set all arguments.
    thwclocks"^\s*RTC in local TZ\s*:\s*([^\s]+)RQs^\s*Time ?zone\s*:\s*([^\s]+)s
set-local-rtcsset-timezonecC`sZtt|�j|�|jddt�|_t�|_d|jkrV|j	�ndS(NRtrequiredRQ(
RRR1RRARR2RR3RW(R6R)((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR1s
cC`s9||jkr.|j|jd�|j|<n|j|S(NR(RRGR(R6RM((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyt_get_status$scC`sb|j|�}|j|j|�jd�}|dkr^|jj|�rUd}q^d}n|S(NiR[tlocaltUTC(R]tregexpstsearchtgroupR)tboolean(R6R7RMRR3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRB)s		cC`sQ|dkr*|dkr!d}q*d}n|j|j|j||dt�dS(NR[R^tyestnoR@(RGRtsubcmdsRA(R6R7R3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRO4s
		(
RXRYRZR2Rtcompilet	MULTILINER`RfR1R]RBRO(((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRs				Rc	B`s
eZdZedddddd�Zededede�Zedddej	dej
�dej	dej
��Zedej	dej
�d	ej	d
ej
��Zeddd	d�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(sfThis is a Timezone manipulation class for non systemd-powered Linux.

    For timezone setting, it edits the following file and reflect changes:
        - /etc/sysconfig/clock  ... RHEL/CentOS
        - /etc/timezone         ... Debian/Ubuntu
    For hwclock setting, it executes `hwclock --systohc` command with the
    '--utc' or '--localtime' option.
    RQR[tadjtimes/etc/adjtimes^UTC\s*=\s*([^\s]+)s
^(UTC|LOCAL)$tSuSEs^TIMEZONE\s*=\s*"?([^"\s]+)"?tredhats^ZONE\s*=\s*"?([^"\s]+)"?sTIMEZONE="%s"
s
ZONE="%s"
cC`s�tt|�j|�d|jkr\|j�}d|jjddt�|fg|_n|jjddt�|_	|jjd�dk	r$d|jkr�d|jjddt�|fd	|jjddt�g|_nd
|jd<d|jd<tj
dtj�|jd<d
|_n�|jjd�dk	rrtjjd�sr|jjddt�g|_qrnd|jd<d|jd<yt|jdd�}Wn�tk
rH}|j|d�r-t�}|dkr|jd|jd<|jd|_qE|jd|jd<|jd|_q�|jd|jd�nzX|j�}|j�tjd|tj�r�|jd|jd<|jd|_n$|jd|jd<|jd|_dS(NRQs)%s --remove-destination %s /etc/localtimetcpR\R[sdpkg-reconfigures%s -sf %s /etc/localtimetlns#%s --frontend noninteractive tzdatas
/etc/timezones/etc/default/rcSs	^([^\s]+)s%s
s
tzdata-updates/etc/localtimes/etc/sysconfig/clocktrRjRks&could not read configuration file "%s"s
^TIMEZONE\s*=(RRR1R3RWR)RRAtupdate_timezonetupdate_hwclockRt
conf_filesRRgRhR`t
tzline_formatRRRStislinktopentIOErrort_allow_ioerrorR
tdist_regexpstdist_tzline_formatR=treadtcloseRa(R6R)RVtfterrtdistributiontsysconfig_clock((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR1esH+%

$

	
cC`s)|jtjkrtS|jj|t�S(N(terrnotENOENTRCt
allow_no_fileRB(R6R|R7((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRv�scC`s�yt|d�}WnEtk
rZ}|j||�r@g}qq|jd||f�nX|j�}|j�g}x9t|�D]+\}	}
|j|
�r�|j|	�q�q�Wt	|�dkr�|d}nd}x"|ddd�D]
}	||	=q�W|j
||�yt|d�}Wn(tk
rJ|jd||f�nX|j|�|j�|jjdt	|�|f�dS(	s�Replace the first matched line with given `value`.

        If `regexp` matched more than once, other than the first line will be deleted.

        Args:
            filename: The name of the file to edit.
            regexp:   The regular expression to search with.
            value:    The line which will be inserted.
            key:      For what key the file is being editted.
        Rns>tried to configure %s using a file "%s", but could not read itiNi����twsBtried to configure %s using a file "%s", but could not write to its)Added 1 line and deleted %s line(s) on %s(
RtRuRvR=t	readlinesRzt	enumerateRaR9R8tinsertt
writelinesR(R6tfilenametregexpR3R7tfileR|tlinestmatched_indicestitlinetinsert_line((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyt
_edit_file�s2	




cC`s�|j|}yt|dd�}Wnotk
r�}|j||�rz|dkrWdS|dkrgdS|dkr�dSq�|jd||f�n�X|j�}|j�y#|j|j|�j	d	�}Wngt
k
r7|dkr�dS|dkr�dS|dkr�|d
krdS|jd||f�q�n[X|dkrh|jj|�r_d}q�d}n*|dkr�|dkr�|j
�}q�n|S(
NtmodeRnR[sn/aRiR_RQs>tried to configure %s using a file "%s", but could not read itiRHsOtried to configure %s using a file "%s", but could not find a valid value in itR^(RqRtRuRvR=RyRzR`RaRbtAttributeErrorR)Rctlower(R6R7RMR�R�R|RR3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyt_get_value_from_config�sB

#
		cC`sU|j|d}|dkrS|j||�}||krQ|jd|�}qQn�|dkr@|j||�}||krQtjjd�rtjjd�r�tjd�}tjd|tj	�}|r�|j
d�}||kr�|}q�qd}q:d}q=ytjdd	|�s$dSWq=t
k
r9dSXqQn|jd
|�|S(NR0R[RiRQs/etc/localtimes/usr/share/zoneinfo/(.*)isn/as/usr/share/zoneinfo/sunknown parameter "%s"(R3R�RRRSRstexiststreadlinkRRaRhRbtfilecmptcmpt	ExceptionR=(R6R7RMR0R3RStlinktzt	valuelink((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRB
s2		
c	C`s\|jd|jdd|jdd|j|dd�x|jD]}|j|�qAWdS(NR�RQR�R3R7(R�RqR`RrRoRG(R6R3tcmd((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pytset_timezone7s

c	C`s�|dkrd}d}nd}d}|jddk	rq|jd|jdd|jdd	d
|dd�n|j|jd|d
t�dS(NR^s--localtimeRes--utcRdR[R�R�R3sUTC=%s
R7s	--systohcR@(RqRR�R`RGRpRA(R6R3toptiontutc((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pytset_hwclock?s	


cC`sM|dkr|j|�n-|dkr8|j|�n|jd|�dS(NRQR[sunknown parameter "%s"(R�R�R=(R6R7R3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyROMs
N(RXRYRZR2RRqRAR�RRgRhR`RwRxR1RvR�R�RBR�R�RO(((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR>s6				>	
	.	/	-		R!cB`s)eZdZd�Zd�Zd�ZRS(sThis is a Timezone manipulation class for SmartOS instances.

    It uses the C(sm-set-timezone) utility to set the timezone, and
    inspects C(/etc/default/init) to determine the current timezone.

    NB: A zone needs to be rebooted in order for the change to be
    activated.
    cC`sQtt|�j|�|jjddt�|_|jsM|jdd�ndS(Nssm-set-timezoneR\RsFsm-set-timezone not found. Make sure the smtools package is installed.(RR!R1R)RRCtsettimezoneR (R6R)((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR1`s	cC`s�|dkr�yPtdd�}x:|D]2}tjd|j��}|r%|j�dSq%WWq�tk
r�|jjdd�q�Xn|jjdd|�d	S(
s�Lookup the current timezone name in `/etc/default/init`. If anything else
        is requested, or if the TZ field is not set we fail.
        RQs/etc/default/initRns	^TZ=(.*)$iRs Failed to read /etc/default/inits/%s is not a supported option on target platformN(RtRRRtgroupsR�R)R (R6R7RMR{R�tm((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRBfs

cC`s�|dkr�d|}|jj|�\}}}|dkrS|jjd|�ntjd||j�d�}|o�|j�d|ks�|jjdd�q�n|jjdd	|�d
S(s�Set the requested timezone through sm-set-timezone, an invalid timezone name
        will be rejected and we have no further input validation to perform.
        RQssm-set-timezone %siRs'^\* Changed (to)? timezone (to)? (%s).*ii����sFailed to set timezones/%s is not a supported option on target platformN(R)RR RRt
splitlinesR�(R6R7R3R�R*R+R,R�((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyROvs
 (RXRYRZR1RBRO(((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR!Vs		R"cB`sYeZdZedejdej��Zd�Zd�Z	d�Z
d�Zd�ZRS(s�This is the timezone implementation for Darwin which, unlike other *BSD
    implementations, uses the `systemsetup` command on Darwin to check/set
    the timezone.
    RQs^\s*Time ?Zone\s*:\s*([^\s]+)cC`sZtt|�j|�|jddt�|_t�|_d|jkrV|j	�ndS(NtsystemsetupR\RQ(
RR"R1RRAR�R2RR3RW(R6R)((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR1�s
cC`s9||jkr.|j|jd�|j|<n|j|S(s;Lookup the current timezone via `systemsetup -gettimezone`.s-gettimezone(RRGR�(R6RM((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyt_get_current_timezone�scC`sl|jdd}|j|jd�j�d}ttd�|��}||krh|jd|�n|S(NRQR0s-listtimezonesicS`s
|j�S(N(R(tx((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyt<lambda>�ss$given timezone "%s" is not available(R3RGR�R�tlisttmapR=(R6RUtoutttz_list((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRW�scC`sY|dkr>|j|�}|j|j|�jd�}|S|jjdd|�dS(NRQiRs/%s is not a supported option on target platform(R�R`RaRbR)R (R6R7RMRR3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRB�s
cC`sF|dkr+|j|jd|dt�n|jjdd|�dS(NRQs-settimezoneR@Rs/%s is not a supported option on target platform(RGR�RAR)R (R6R7R3((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRO�s(
RXRYRZR2RRgRhR`R1R�RWRBRO(((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR"�s			
	R#cB`s2eZdZd�Zd�Zd�Zd�ZRS(s�This is the timezone implementation for *BSD which works simply through
    updating the `/etc/localtime` symlink to point to a valid timezone name under
    `/usr/share/zoneinfo`.
    cC`stt|�j|�dS(N(RR#R1(R6R)((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR1�scC`s$d}d}tjj|�s2|jjd�dS|}xK|j|�suytj|�}Wq;tk
rqPq;Xq;W|j|d�Sx�t	tj
|��D]p\}}}x^t	|�D]P}tjj||�}tjj|�r�t
j||�r�|j|d�Sq�Wq�W|jjd�dS(Ns/usr/share/zoneinfo/s/etc/localtimes,Could not read /etc/localtime. Assuming UTC.R_tsCCould not identify timezone name from /etc/localtime. Assuming UTC.(RRRSR�R)Rt
startswithR�tOSErrortreplacetsortedtwalkR;RsR�R�(R6tzoneinfo_dirtlocaltime_filet
zoneinfo_filetdnameR.tfnamestfname((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyt__get_timezone�s&
	%%cC`s1|dkr|j�S|jjdd|�dS(s:Lookup the current timezone by resolving `/etc/localtime`.RQRs/%s is not a supported option on target platformN(t_BSDTimezone__get_timezoneR)R (R6R7RM((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRB�s
cC`s/|dkrd|}y0tjj|�sE|jjdd|�nWn(tk
rp|jjdd|�nXdjgtdd�D]}tj	t
jt
j�^q��}d	|}y$tj
||�tj|d
�Wq+tk
rtj|�|jjdd�q+Xn|jjdd|�dS(
NRQs/usr/share/zoneinfo/Rs%s is not a recognized timezonesFailed to stat %sR�ii
s/etc/localtime.s/etc/localtimesCould not update /etc/localtimes/%s is not a supported option on target platform(RRRSRTR)R R�R;trangetrandomtchoicetstringt
ascii_letterstdigitstsymlinktrenametremove(R6R7R3tzonefileR�tsuffixt
new_localtime((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRO�s 

>


(RXRYRZR1R�RBRO(((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR#�s
		$	R'cB`s2eZdZd�Zd�Zd�Zd�ZRS(s�This is a Timezone manipulation class for AIX instances.

    It uses the C(chtz) utility to set the timezone, and
    inspects C(/etc/environment) to determine the current timezone.

    While AIX time zones can be set using two formats (POSIX and
    Olson) the prefered method is Olson.
    See the following article for more information:
    https://developer.ibm.com/articles/au-aix-posix/

    NB: AIX needs to be rebooted in order for the change to be
    activated.
    cC`s5tt|�j|�|jjddt�|_dS(NtchtzR\(RR'R1R)RRAR�(R6R)((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR1scC`s�y)tdd�}|j�}|j�Wn$tk
rO|jjdd�nXtjd|tj�}|r{|j	d�SdSdS(s5 Return the current value of TZ= in /etc/environment s/etc/environmentRnRs*Issue reading contents of /etc/environments	^TZ=(.*)$iN(RtRyRzR�R)R RRaRhRbR(R6R{tetcenvironmentR((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR� s

cC`s1|dkr|j�S|jjdd|�dS(s�Lookup the current timezone name in `/etc/environment`. If anything else
        is requested, or if the TZ field is not set we fail.
        RQRs/%s is not a supported option on target platformN(t_AIXTimezone__get_timezoneR)R (R6R7RM((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRB/s
c
C`s|dkr�d|}y0tjj|�sE|jjdd|�nWn(tk
rp|jjdd|�nXd|}|jj|�\}}}|dkr�|jjd|�n|j�}||krd||f}	|jjd|	�qn|jjdd	|�d
S(s�Set the requested timezone through chtz, an invalid timezone name
        will be rejected and we have no further input validation to perform.
        RQs/usr/share/lib/zoneinfo/Rs %s is not a recognized timezone.sFailed to check %s.schtz %sis?TZ value does not match post-change (Actual: %s, Expected: %s).s/%s is not a supported option on target platformN(RRRSRTR)R R�RR�(
R6R7R3R�R�R*R+R,tTZR((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyRO8s 


(RXRYRZR1R�RBRO(((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyR'
s

				cC`s�tdtdtdddddgdd	g�d
tdd��ddd
ggdt�}t|�}|jd
d�|jr�|jdd�}|jd�|d<n||j�|jd
d�|jdd�j	�\}}||kr|j
dt|�t|�f�n|jdd�}|d|dk}t|j
�dkrw|jd|d|ddj|j
��n|jd|d|�dS(NR4R[ttypetstrtchoicesR^R_taliasestrtcRQtrequired_one_oftsupports_check_modeRMRHR0RIsJstill not desired state, though changes have made - planned: %s, after: %sitchangedRLRs
(RR2RARRNt
check_modeRLtpopRPtvaluesR=R�R8Rt	exit_jsonR;(R)RURLRIR0R�((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pytmaines,$		
	+t__main__(!t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtRETURNtEXAMPLESRRRRR�RR�R�tansible.module_utils.basicRR	R
tansible.module_utils.sixRtobjectRRRR!R"R#R'R�RX(((sC/usr/lib/python2.7/site-packages/ansible/modules/system/timezone.pyt<module>s6


,�2�51QX	'

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