diff --git a/bind/README.md b/bind/README.md index 53f693a8..8d75b1e6 100644 --- a/bind/README.md +++ b/bind/README.md @@ -10,4 +10,4 @@ Minimal configuration is in `tasks/main.yml` The full list of variables (with default values) can be found in `defaults/main.yml`. -waening : sync chroot-bind.sh +warning : sync chroot-bind.sh diff --git a/bind/files/chroot-bind.sh b/bind/files/chroot-bind.sh index 08c665e8..5273e5a1 100644 --- a/bind/files/chroot-bind.sh +++ b/bind/files/chroot-bind.sh @@ -7,8 +7,10 @@ # Exec this script after `(apt-get|aptitude|apt) install bind9` # and after *each* bind9 upgrade -# When the script is finished, ensure you have -# 'OPTIONS="-u bind -t /var/chroot-bind"' in /etc/default/bind9 +# When the script is finished, ensure you have (since Bullseye) +# 'OPTIONS="-u bind -t /var/chroot-bind"' in /etc/default/named +### or (until Buster) +### 'OPTIONS="-u bind -t /var/chroot-bind"' in /etc/default/bind9 # and /etc/init.d/bind9 (re)start # # for Jessie/systemd only: diff --git a/bind/tasks/main.yml b/bind/tasks/main.yml index 1e20eee2..0e5c7fea 100644 --- a/bind/tasks/main.yml +++ b/bind/tasks/main.yml @@ -94,13 +94,25 @@ - bind_chroot_set | bool - chrootbind_run.stdout | length > 0 -- name: Modify OPTIONS in /etc/default/bind9 for chroot +- name: Modify OPTIONS in /etc/default/bind9 for chroot (until Buster) ansible.builtin.replace: dest: /etc/default/bind9 regexp: '^OPTIONS=.*' replace: 'OPTIONS="-u bind -t {{ bind_chroot_path }}"' notify: restart bind - when: bind_chroot_set | bool + when: + - bind_chroot_set | bool + - ansible_distribution_major_version is version('11', '<') + +- name: Modify OPTIONS in /etc/default/named for chroot (since Bullseye) + ansible.builtin.replace: + dest: /etc/default/named + regexp: '^OPTIONS=.*' + replace: 'OPTIONS="-u bind -t {{ bind_chroot_path }}"' + notify: restart bind + when: + - bind_chroot_set | bool + - ansible_distribution_major_version is version('11', '>=') - name: logrotate for bind ansible.builtin.template: