mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #13621 from nmadhok/fix-ddns
Changing return from ddns.absent and making minor fixes in the doc
This commit is contained in:
commit
4dd77f8c5e
@ -8,15 +8,15 @@ Support for RFC 2136 dynamic DNS updates.
|
||||
support this (the keyname is only needed if the keyring contains more
|
||||
than one key)::
|
||||
|
||||
ddns.keyring: keyring file (default=None)
|
||||
ddns.keyname: key name in file (default=None)
|
||||
keyring: keyring file (default=None)
|
||||
keyname: key name in file (default=None)
|
||||
|
||||
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:: bash
|
||||
|
||||
{'keyname.': 'keycontent'}
|
||||
{"keyname.": "keycontent"}
|
||||
'''
|
||||
# Import python libs
|
||||
import logging
|
||||
|
@ -12,6 +12,9 @@ type dynamic updates. Requires dnspython module.
|
||||
ddns.present:
|
||||
- zone: example.com
|
||||
- ttl: 60
|
||||
- data: 111.222.333.444
|
||||
- nameserver: 123.234.345.456
|
||||
- keyfile: /srv/salt/tsig_key.txt
|
||||
'''
|
||||
|
||||
|
||||
@ -39,7 +42,7 @@ def present(name, zone, ttl, data, rdtype='A', **kwargs):
|
||||
DNS resource type. Default 'A'.
|
||||
|
||||
``**kwargs``
|
||||
Additional arguments the ddns.update function may need (e.g. keyfile).
|
||||
Additional arguments the ddns.update function may need (e.g. nameserver, keyfile, keyname).
|
||||
'''
|
||||
ret = {'name': name,
|
||||
'changes': {},
|
||||
@ -90,7 +93,7 @@ def absent(name, zone, data=None, rdtype=None, **kwargs):
|
||||
DNS resource type. If omitted, all types will be purged.
|
||||
|
||||
``**kwargs``
|
||||
Additional arguments the ddns.update function may need (e.g. keyfile).
|
||||
Additional arguments the ddns.delete function may need (e.g. nameserver, keyfile, keyname).
|
||||
'''
|
||||
ret = {'name': name,
|
||||
'changes': {},
|
||||
@ -110,7 +113,10 @@ def absent(name, zone, data=None, rdtype=None, **kwargs):
|
||||
elif status:
|
||||
ret['result'] = True
|
||||
ret['comment'] = 'Deleted DNS record(s)'
|
||||
ret['changes'] = True
|
||||
ret['changes'] = {'Deleted': {'name': name,
|
||||
'zone': zone
|
||||
}
|
||||
}
|
||||
else:
|
||||
ret['result'] = False
|
||||
ret['comment'] = 'Failed to delete DNS record(s)'
|
||||
|
Loading…
Reference in New Issue
Block a user