From cf8cca745edd2c6e8d8d53be66735322aca988c6 Mon Sep 17 00:00:00 2001 From: Patrick Marchand Date: Tue, 26 Nov 2019 17:17:48 -0500 Subject: [PATCH] hardcode chrooted bind variables The current chroot-bind.sh is legacy code that cannot be migrated without a proper understanding of it's historical context. This context might still apply and this script is still used on a variety of new and old machines. By hardcoding the paths when the user requests a chroot, we limit possible breakage. --- bind/defaults/main.yml | 5 +++-- bind/tasks/main.yml | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bind/defaults/main.yml b/bind/defaults/main.yml index 4008b394..99b33e13 100644 --- a/bind/defaults/main.yml +++ b/bind/defaults/main.yml @@ -2,9 +2,10 @@ bind_recursive_server: False bind_authoritative_server: True bind_chroot_set: True -bind_chroot_path: /var/chroot-bind +# Until chroot-bind.sh is migrated to ansible, we hardcode the chroot paths. +#bind_chroot_path: /var/chroot-bind bind_systemd_service_path: /etc/systemd/system/bind9.service bind_statistics_file: /var/run/named.stats bind_log_file: /var/log/bind.log bind_query_file: /var/log/bind_queries.log -bind_cache_dir: /var/cache/bind \ No newline at end of file +bind_cache_dir: /var/cache/bind diff --git a/bind/tasks/main.yml b/bind/tasks/main.yml index b7a0f6bd..59291143 100644 --- a/bind/tasks/main.yml +++ b/bind/tasks/main.yml @@ -1,3 +1,13 @@ +# Until chroot-bind.sh is migrated to ansible, we hardcode the chroot paths. +- name: set chroot variables + set_fact: + bind_log_file: /var/log/bind.log + bind_query_file: /var/log/bind_queries.log + bind_cache_dir: /var/cache/bind + bind_statistics_file: /var/run/named.stats + bind_chroot_path: /var/chroot-bind + when: bind_chroot_set + - name: package are installed apt: name: '{{ item }}'