bertvv/ansible-role-bind

Requirement to set primaries even if type=primary

Opened this issue · 0 comments

There are 2 places where the primaries attribute of a zone is used:

tasks/zones.yml

(item.type is defined and item.type == 'primary') or
    (item.type is not defined and item.primaries is defined and
    (host_all_addresses | intersect(item.primaries) | length > 0))

(this code fragment is used for 3 tasks)

templates/etc_named.conf.j2

bind_zone.type is not defined and bind_zone.primaries is defined and (...)

As you can see, the primaries attribute is only evaluated if the type attribute is not defined.

However, this is currently not reflected in the assertion in tasks/main.yml:

  assert:
    that:
      - item.primaries is defined or item.forwarders is defined

Expected behavior for this assertion would be to pass, if item.type is set to primary.