Skip to content

named: Zone definitions disappeared after upgrading ansible-core to 2.19 #29

@brlin-tw

Description

@brlin-tw
SUMMARY

After upgrading Ansible to >=2.19 the zone definitions are missing from the generated named.conf file.

STEPS TO REPRODUCE
  1. Upgrade your Ansible installation to 2.19.
  2. Deploy as usual.
  3. Check the content of the installed named.conf file
EXPECTED RESULTS

Zone definitions are available in the named.conf file.

ACTUAL RESULTS

No zone definitions are available.

In my specific play, my task failed with the following error due to the missing definition:

failed: [auth-secondary1] (item={'name': 'internal.test', 'type': 'secondary', 'primaries': ['192.168.56.11']}) => 
    ansible_loop_var: zone
    changed: true                                        
    cmd:                                                 
    - rndc
    - retransfer                                                                                                   
    - internal.test    
    delta: '0:00:00.022424'
    end: '2025-10-03 10:57:13.465686'
    msg: non-zero return code
    rc: 1                                                                                                          
    start: '2025-10-03 10:57:13.443262'                                                                                stderr: |-
        rndc: 'retransfer' failed: not found                                                                               no matching zone 'internal.test' in any view
    stderr_lines: <omitted>                                                                                            stdout: ''
    stdout_lines: <omitted>                                                                                            zone:
        name: internal.test
        primaries:                                                                                                 
        - 192.168.56.11
        type: secondary

There's also a weird warning message in an earlier task:

TASK [bodsch.dns.bind : Create reverse lookup zone file] *********************************************************$
skipping: [cache1]                                                                                                 
skipping: [cache2]                                                                                                 
skipping: [auth-secondary1]                                                                                        
ok: [auth-primary] => (item=192.168.56)                                                                            
[WARNING]: WorkerProcess for [auth-primary/TASK: bodsch.dns.bind : Create reverse lookup zone file] errantly sent data directly to stderr instead of using Display:                                                                   
    INFO:root: = 56.168.192.in-addr.arpa                                                                           
ENVIRONMENT

OS version of the control node: Ubuntu 24.04
Ansible distribution: PyPI (via pipx)
Collection version: 1.2.0 (current latest in Ansible Galaxy)

ansible --version
ansible [core 2.19.0]
  config file = REDACTED/ansible.cfg
  configured module search path = ['/home/brlin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/brlin/.local/share/pipx/venvs/ansible/lib/python3.12/site-packages/ansible
  ansible collection location = REDACTED/playbooks/collections
  executable location = /home/brlin/.local/bin/ansible
  python version = 3.12.6 (main, Sep  9 2024, 14:41:06) [GCC 13.3.0] (/home/brlin/.local/share/pipx/venvs/ansible/bin/python)
  jinja version = 3.1.6
  pyyaml version = 6.0.3 (with libyaml v0.2.5)
WORKAROUNDS

Downgrade the ansible-core package to 2.18:

pipx inject ansible ansible-core==2.18

According to my testing, 2.16 also works.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions