
    Vh?                     x    d dl mZmZmZ eZddgddZdZdZdZ	d d	l
mZ d d
lmZmZ d Zd Zedk(  r e        yy)    )absolute_importdivisionprint_functionz1.1preview	certified)metadata_versionstatussupported_bya?  
---
module: ucs_timezone
short_description: Configures timezone on Cisco UCS Manager
description:
- Configures timezone on Cisco UCS Manager.
extends_documentation_fragment: cisco.ucs.ucs
options:
  state:
    description:
    - If C(absent), will unset timezone.
    - If C(present), will set or update timezone.
    choices: [absent, present]
    default: present
    type: str

  admin_state:
    description:
    - The admin_state setting
    - The enabled admin_state indicates the timezone configuration is utilized by UCS Manager.
    - The disabled admin_state indicates the timezone configuration is ignored by UCS Manager.
    choices: [disabled, enabled]
    default: enabled
    type: str

  description:
    description:
    - A user-defined description of the timezone.
    - Enter up to 256 characters.
    - "You can use any characters or spaces except the following:"
    - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)."
    aliases: [ descr ]
    type: str

  timezone:
    description:
    - The timezone name.
    - Time zone names are from the L(tz database,https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
    - The timezone name is case sensitive.
    - The timezone name can be between 0 and 510 alphanumeric characters.
    - You cannot use spaces or any special characters other than
    - "\"-\" (hyphen), \"_\" (underscore), \"/\" (backslash)."
    type: str

requirements:
- ucsmsdk
author:
- David Soper (@dsoper2)
- John McDonough (@movinalot)
- CiscoUcs (@CiscoUcs)
a  
- name: Configure Time Zone
  cisco.ucs.ucs_timezone:
    hostname: 172.16.143.150
    username: admin
    password: password
    state: present
    admin_state: enabled
    timezone: America/Los_Angeles
    description: 'Time Zone for Los Angeles'

- name: Unconfigure Time Zone
  cisco.ucs.ucs_timezone:
    hostname: 172.16.143.150
    username: admin
    password: password
    state: absent
    admin_state: disabled
z
#
)AnsibleModule)	UCSModuleucs_argument_specc                     t        j                         } | j                  t        d      t        ddg      t        ddddg      t        dddd	g      
       t	        | ddddggg      }t        |      }d}d}	 d}d}d}|j                  j                  |      }|rd}|j                  d   d	k(  rW|r*|j                  sEd|_
        d|_        |j                  j                  |d       |j                  j                          d}n|rQt        |j                  d         }	|j                  d   |	d<   |j                  d   |	d<    |j                  di |	rd}|s|j                  ss|j                  d   |_
        |j                  d   |_        |j                  d   |_        |j                  j                  |d       |j                  j                          d}||j$                  d<   |r |j&                  di |j$                    |j(                  di |j$                   y # t         $ r'}
d}dt#        |
      z  |j$                  d<   Y d }
~
ud }
~
ww xY w)Nstr)typedescr)r   aliasesenableddisabled)r   defaultchoicespresentabsent)timezonedescriptionadmin_statestateTr   r   )supports_check_moderequired_ifFzsys/svc-ext/datetime-svc )modify_presentr   )r   r   zsetup error: %s msgchanged )r   copyupdatedictr   r   login_handlequery_dnparams
check_moder   r   add_mocommitcheck_prop_matchr   	Exceptionr   result	fail_json	exit_json)argument_specmoduleucserrr"   	mo_existsprops_matchdnmokwargses              j/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/cisco/ucs/plugins/modules/ucs_timezone.py
run_moduler=   ]   sN   %**,M5!egY7eYY@WXy9h:OP	    i*.
F F
C
CG(8	'&&r*I==!X-(("$BK!BH$$++Bt+D$$++-FMM-$@A%+]]:%>z"(.m(D}%&2&&00"&K(("(--
";BK%}}];BH%+]]=%ABN$$++Bt+D$$++- $CJJy
&3::&F"szz"  8.Q7

58s   ?E$H- -	I6IIc                      t                y )N)r=   r#       r<   mainr@      s    Lr?   __main__N)
__future__r   r   r   r   __metaclass__ANSIBLE_METADATADOCUMENTATIONEXAMPLESRETURNansible.module_utils.basicr   6ansible_collections.cisco.ucs.plugins.module_utils.ucsr   r   r=   r@   __name__r#   r?   r<   <module>rK      sd    A @(-(k$/1 2h(
 5 _B#J zF r?   