zuul-jobs/roles/validate-zone-db/tasks/main.yaml
Clark Boylan 5f3c90057c Fix check zone role for Jammy
Ubuntu Jammy installs the named-checkzone tool to
/usr/bin/named-checkzone, but old ubuntu installed to
/usr/sbin/named-checkzone. Rather than try and keep track of the
different locations we update the task to run under the shell module so
that we can rely on $PATH to do the heavy lifting for us.

To help ensure this doesn't break the old path and to catch problems
earlier I have also added testing across the debuntu set of platforms.
The role doesn't currently support other platforms as it relies on the
bind9utils package.

Change-Id: I1650b605cb6f25fa7585524b427d65d2fc291338
2022-11-02 14:26:07 -07:00

23 lines
632 B
YAML

- name: Install bind9utils
package:
name: bind9utils
state: present
become: yes
- name: Build zone.db list
include_tasks: find.yaml
when: not zone_db_files
- name: 'Run checkzone'
# Use shell so that $PATH can be used to lookup the executable path.
# Jammy installs to /usr/bin but older releases install to /usr/sbin.
shell: |
# Explicitly add /usr/sbin to path in case it isnt already there.
export PATH=$PATH:/usr/sbin
named-checkzone {{ zj_zone_db_file[0] }} {{ zj_zone_db_file[1] }}
loop: "{{ zone_db_files }}"
loop_control:
loop_var: zj_zone_db_file
tags:
- skip_ansible_lint