Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error definind zone in view #2

Open
kemeris2000 opened this issue Apr 24, 2021 · 2 comments
Open

Error definind zone in view #2

kemeris2000 opened this issue Apr 24, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@kemeris2000
Copy link

kemeris2000 commented Apr 24, 2021

I get error "No first item, sequence was empty" when defining zone in view.

dubzland_bind9_views:
  - name: internal
    match_clients:
      - internals
    recursion: 'no'
    includes:
      - '/etc/named.conf.internals'
    zones:
      - name: domain1.com
        type: master
        domain_name: domain1.com
TASK [ansible-role-bind : ensure view based zone files exist] ******************
fatal: [maria1.vm.domain1.com]: FAILED! => {"msg": "No first item, sequence was empty."}

Any ideas what could be wrong?

@t3hpr1m3
Copy link
Member

@kemeris2000 At first glance, it looks like the error is caused by the lack of nameservers defined in the zone (see here:

@ IN SOA {{ zone.nameservers | map(attribute='name') | first }}. {{ zone.hostmaster | default("hostmaster." + zone.name) }}. (
).

I'll add a check for that and generate a better error message. In the meantime, define some nameservers (at least the one you're configuring) and you should be ok.

@t3hpr1m3 t3hpr1m3 added the bug Something isn't working label Apr 24, 2021
@t3hpr1m3 t3hpr1m3 self-assigned this Apr 24, 2021
@kemeris2000
Copy link
Author

kemeris2000 commented Apr 24, 2021

@t3hpr1m3 You are right, problem because of missing nameservers. The following works:

dubzland_bind9_views:
  - name: internal
    match_clients:
      - internals
    recursion: 'no'
    includes:
      - '/etc/named.conf.internals'
    zones:
      - name: domain1.com
        type: master
        domain_name: domain1.com
        nsupdate_key: DHCP_UPDATER
        nameservers:
          - name: ns1.domain1.com
          - name: ns1.domain1.com

I think you should update example, as you code expect list of dictionary for nameservers instead of list.

#
# - name: example.com
# type: master
# domain_name: example.com
# nameservers:
# - ns1.example.com
# - ns1.example.com

t3hpr1m3 added a commit that referenced this issue Oct 25, 2021
Add vars for Debian 11 (bullseye).

Closes #2

See merge request dubzland/ansible-role-bind9!2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants