�
�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
Z
d d l m Z d d
l
m Z d d l j j Z d d l m Z d d l m Z e j � Z d e f d � � YZ d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust certifiedt supported_bysf
module: na_ontap_dns
short_description: NetApp ONTAP Create, delete, modify DNS servers.
extends_documentation_fragment:
- netapp.na_ontap
version_added: '2.7'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Create, delete, modify DNS servers.
options:
state:
description:
- Whether the DNS servers should be enabled for the given vserver.
choices: ['present', 'absent']
default: present
vserver:
description:
- The name of the vserver to use.
required: true
domains:
description:
- List of DNS domains such as 'sales.bar.com'. The first domain is the one that the Vserver belongs to.
nameservers:
description:
- List of IPv4 addresses of name servers such as '123.123.123.123'.
skip_validation:
type: bool
description:
- By default, all nameservers are checked to validate they are available to resolve.
- If you DNS servers are not yet installed or momentarily not available, you can set this option to 'true'
- to bypass the check for all servers specified in nameservers field.
version_added: '2.8'
s6
- name: create DNS
na_ontap_dns:
state: present
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
vserver: "{{vservername}}"
domains: sales.bar.com
nameservers: 10.193.0.250,10.192.0.250
skip_validation: true
s
N( t
AnsibleModule( t to_native( t NetAppModule( t OntapRestAPIt NetAppOntapDnsc B` sD e Z d Z d � Z d � Z d � Z d � Z d � Z d � Z RS( s
Enable and Disable dns
c C` s� t | _ t j � | _ | j j t d t d t d d d g d d � d t d t d d � d
t d t d d � d t d t d d � d
t d t d d � � � t d | j d d d d
d g f g d t � | _ t
� | _ | j j | j j
� | _ t | j � | _ d
g } g | D] } | | j k r| ^ q} | j j | � \ | _ } | d k rz| j j d | � n | j s�t t k r�| j j d d � q�t j d | j d | j d � | _ n d S( Nt statet requiredt choicest presentt absentt defaultt vservert typet strt domainst listt nameserverst skip_validationt boolt
argument_spect required_ift supports_check_modet msgs( the python NetApp-Lib module is requiredt module( t Falset use_restt netapp_utilst na_ontap_host_argument_specR t updatet dictt TrueR R R
t na_helpert set_parameterst paramst
parametersR t restApit is_restt Nonet fail_jsont HAS_NETAPP_LIBt setup_na_ontap_zapit server( t selft unsupported_rest_propertiest xt used_unsupported_rest_propertiest error( ( sO /usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_dns.pyt __init__S s2 ! ( (c C` s | j r� d } i } | j d | d <| j d | d <i | j d d 6| d <| j j | | � \ } } | r| j j d | � qn�t j j d � } t j j d
� } t j j d � } xA | j d D]2 } t j j d � } | j | � | j
| � q� W| j
| � xA | j d D]2 } t j j d � }
|
j | � | j
|
� qW| j
| � | j j d
� r�t j j d � } | j t | j d
� � | j
| � n y | j
j | t � WnB t j j k
r
} | j j d d t | � d t j � � n Xd S( s9
Create DNS server
:return: none
s name-services/dnsR R t serversR t namet svmR s net-dns-creates name-serverss
ip-addresst stringR s skip-config-validations Error creating dns: %st exceptionN( R! R* R+ t postR R. R"