�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z 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 � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
---
module: ucs_dns_server
short_description: Configure DNS servers on Cisco UCS Manager
extends_documentation_fragment:
- ucs
description:
- Configure DNS servers on Cisco UCS Manager.
- Examples can be used with the L(UCS Platform Emulator,https://communities.cisco.com/ucspe).
options:
state:
description:
- If C(absent), will remove a DNS server.
- If C(present), will add or update a DNS server.
choices: [absent, present]
default: present
type: str
dns_server:
description:
- DNS server IP address.
- Enter a valid IPV4 Address.
- UCS Manager supports up to 4 DNS Servers
aliases: [ name ]
type: str
description:
description:
- A user-defined description of the DNS server.
- 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
delegate_to:
description:
- Where the module will be run
default: localhost
type: str
requirements:
- ucsmsdk
author:
- John McDonough (@movinalot)
- CiscoUcs (@CiscoUcs)
version_added: "2.8"
s�
- name: Configure DNS server
ucs_dns_server:
hostname: 172.16.143.150
username: admin
password: password
dns_server: 10.10.10.10
description: DNS Server IP address
state: present
delegate_to: localhost
- name: Remove DNS server
ucs_dns_server:
hostname: 172.16.143.150
username: admin
password: password
dns_server: 10.10.10.10
state: absent
delegate_to: localhost
s
#
( t
AnsibleModule( t UCSModulet ucs_argument_specc C` sf t } | j d t d d d d g � d t d d d d g d d � d
t d d d d d d d
g � d t d d d d � � t | d t d d
d d g g g �} t | � } d d l m } t } t } y.t } t } d | j d } | j
j | � } | rt } n | j d
d
k rZ| r�| j sN| j
j
| � | j
j � n t } q�n� | r�t d | j d � }
| j |
� r�t } q�n | s�| j s�| d d d | j d d | j d � } | j
j | d t �| j
j � n t } n Wn0 t k
r+} t } d t | � | j d <n X| | j d <| rR| j | j � n | j | j � d S( Nt
dns_servert typet strt aliasest namet descriptiont descrt defaultt t statet presentt choicest absentt delegate_tot localhostt supports_check_modet required_ifi ( t CommDnsProviders sys/svc-ext/dns-svc/dns-t parent_mo_or_dns sys/svc-ext/dns-svct modify_presents setup error: %s t msgt changed( R
t updatet dictR t TrueR t# ucsmsdk.mometa.comm.CommDnsProviderR t Falset paramst login_handlet query_dnt
check_modet remove_mot committ check_prop_matcht add_mot ExceptionR
t resultt fail_jsont exit_json( t
argument_spect modulet ucsR t errR t mo_existst props_matcht dnt mot kwargst e( ( sX /usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_dns_server.pyt
run_modulea s\ !
c C` s t � d S( N( R<