Skip to content

salt.states.ddns.present: 'NS' record type always returns as changed #37287

Closed

Description

Description of Issue/Question

There is no way to specify a ddns.present state with rdtype = 'NS' that doesn't result in 'changed' status even if the record exists.

With the name parameter set to '@' the record is created if missing but the state always returns changed. Using the zone name or an empty string results in an error:

          ID: ddns_ns_record
    Function: ddns.present
        Name: internal.example.com
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.7/site-packages/salt/state.py", line 1733, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1652, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python2.7/site-packages/salt/states/ddns.py", line 71, in present
                  status = __salt__['ddns.update'](zone, name, ttl, rdtype, data, **kwargs)
                File "/usr/lib/python2.7/site-packages/salt/modules/ddns.py", line 166, in update
                  request = dns.message.make_query(fqdn, rdtype)
                File "/usr/lib/python2.7/site-packages/dns/message.py", line 1058, in make_query
                  qname = dns.name.from_text(qname)
                File "/usr/lib/python2.7/site-packages/dns/name.py", line 654, in from_text
                  raise EmptyLabel
              EmptyLabel: A DNS label is empty.
     Started: 21:12:34.761215
    Duration: 2.247 ms
     Changes:   

I also tried using the unqualified host name 'dns01' as the data parameter, with the same results. Including or omitting the trailing dot in the the zone name also has no effect.

Setup

ddns_ns_record:
  ddns.present:
    - name: '@'
    - zone: 'internal.example.com'
    - data: 'dns01.internal.example.com.'
    - rdtype: 'NS'
    - ttl: 300
    - nameserver: '192.168.100.10'
    - keyfile: '/etc/rndc.key.json'

Steps to Reproduce Issue

Repeatedly invoke the same ddns.present state with rdtype = 'NS'

Versions Report

Salt Version:
Salt: 2016.3.3

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.24.0
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.5 (default, Sep 15 2016, 22:37:39)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4

System Versions:
dist: centos 7.2.1511 Core
machine: x86_64
release: 4.4.19-1-pve
system: Linux
version: CentOS Linux 7.2.1511 Core

Activity

  1. added
    bug
    P4
    severity-medium
    Platform
    on Oct 28, 2016
  2. added this to the Approved milestone on Oct 28, 2016
  3. gtmanfred commented on Oct 28, 2016

    @gtmanfred
    Contributor

    Thanks for reporting this.

    If you wouldn't mind, if you could take a look at the code and see if you can submit a PR to fix it, we would greatly appreciate it. Otherwise, I have this tagged with our Platform team to take a look.

    Thanks!
    Daniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Platformbugseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions