%PDF- %PDF-
| Direktori : /proc/self/root/proc/thread-self/root/lib/python2.7/site-packages/salt/modules/ |
| Current File : //proc/self/root/proc/thread-self/root/lib/python2.7/site-packages/salt/modules/ddns.pyo |
�
���^c @@ s% d Z d d l m Z m Z m Z d d l Z e j e � Z y. d d l Z
d d l Z
d d l Z
e
Z Wn e k
r� Z e Z n Xd d l Z d d l Z d d l m Z d � Z d d � Z d � Z d e
d d
d � Z d d d
d � Z d d e d
d
� Z d d d d d
d � Z d S( uM
Support for RFC 2136 dynamic DNS updates.
:depends: - dnspython Python module
:configuration: If you want to use TSIG authentication for the server, there
are a couple of optional configuration parameters made available to
support this (the keyname is only needed if the keyring contains more
than one key)::
keyfile: keyring file (default=None)
keyname: key name in file (default=None)
keyalgorithm: algorithm used to create the key
(default='HMAC-MD5.SIG-ALG.REG.INT').
Other possible values: hmac-sha1, hmac-sha224, hmac-sha256,
hmac-sha384, hmac-sha512
The keyring file needs to be in json format and the key name needs to end
with an extra period in the file, similar to this:
.. code-block:: json
{"keyname.": "keycontent"}
i ( t absolute_importt print_functiont unicode_literalsN( t sixc C@ s t r
d St d f S( u)
Confirm dnspython is available.
u ddnsuD The ddns execution module cannot be loaded: dnspython not installed.( t dns_supportt False( ( ( s5 /usr/lib/python2.7/site-packages/salt/modules/ddns.pyt __virtual__. s c K@ sZ | d k r | } n | | k r. | | } n( t d d j | � � } | sV d } n | S( u�
Return a value for 'name' from command line args then config file options.
Specify 'key' if the config file option is not the same as 'name'.
u
config.optionu ddns.{0}N( t Nonet __salt__t format( t namet keyt kwargst value( ( s5 /usr/lib/python2.7/site-packages/salt/modules/ddns.pyt _config7 s
c C@ sR d } | rN t j j j | � �( } t j j t j j j | � � } Wd QXn | S( N(
R t saltt utilst filest fopent dnst tsigkeyringt from_textt jsont load( t keyfilet keyringt _f( ( s5 /usr/lib/python2.7/site-packages/salt/modules/ddns.pyt _get_keyringG s
*u 127.0.0.1i i5 c K@ s� t | | | d | | | | | | � } | t k r7 t Sd j | | � }
| j d � d d d � } g } x� t | � d k r� | j d � }
| j |
� d j d j | � d � } d j | � } t | | | d
|
| | | | | � } | rn t Sqn W| S( u�
Add, replace, or update the A and PTR (reverse) records for a host.
CLI Example:
.. code-block:: bash
salt ns1 ddns.add_host example.com host1 60 10.1.1.1
u Au {0}.{1}.u .Ni����i i u {0}.{1}u
in-addr.arpa.u PTR( t updateR R t splitt lent popt appendt joint True( t zoneR
t ttlt ipt
nameservert replacet timeoutt portR t rest fqdnt partst poppedt pt ptr( ( s5 /usr/lib/python2.7/site-packages/salt/modules/ddns.pyt add_hostO s"