From 61211c1996183e769f94883fa0c1dbe8df36d7ca Mon Sep 17 00:00:00 2001 From: Blallo Date: Wed, 19 Aug 2020 18:45:49 +0200 Subject: [PATCH] Use more recent versions Take nsd and unbound from testing --- README.md | 6 ++++++ meta/main.yml | 3 +++ tasks/nsd.yml | 17 ++++++++++++----- tasks/unbound.yml | 18 ++++++++++++++++++ 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 meta/main.yml diff --git a/README.md b/README.md index 863cc29..1d50f2e 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ I need it for my servers ## How? +You need `jnv.debian-backports` as prerequisite role: + +``` +$ ansible-galaxy install jnv.debian-backports +``` + Configure appropriately your inventory to include one **main zone** and pointing out the primary (_star_) and the secondaries (_satellite_). An example [variable file][1] looks like this diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..a94d358 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: jnv.debian-backports diff --git a/tasks/nsd.yml b/tasks/nsd.yml index 1bac46c..eb41239 100644 --- a/tasks/nsd.yml +++ b/tasks/nsd.yml @@ -9,22 +9,29 @@ mode: 0600 register: testing_sources -- name: Ensure only nsd is taken from testing +- name: Ensure nsd is taken from testing copy: content: | Package: nsd Pin: release a=testing Pin-Priority: 999 - - Package: * - Pin: release a=stable - Pin-Priority: 700 dest: /etc/apt/preferences.d/10-nsd-related owner: root group: root mode: 0600 register: repo_config +- name: Ensure only nsd is taken from testing + copy: + content: | + Package: * + Pin: release a=stable + Pin-Priority: 700 + dest: /etc/apt/preferences.d/99-all-the-rest-from-stable + owner: root + group: root + mode: 0600 + - name: Ensure repo are up-to-date apt: update_cache: yes diff --git a/tasks/unbound.yml b/tasks/unbound.yml index baf3638..08d0729 100644 --- a/tasks/unbound.yml +++ b/tasks/unbound.yml @@ -3,6 +3,24 @@ apt: name: unbound state: present + default_release: "{{ ansible_distribution_release }}-backports" + +- name: Ensure only unbound is taken from testing + copy: + content: | + Package: nsd + Pin: release a={{ ansible_distribution_release }}-backports + Pin-Priority: 998 + dest: /etc/apt/preferences.d/20-unbound-related + owner: root + group: root + mode: 0600 + register: repo_config_unbound + +- name: Ensure repo are up-to-date + apt: + update_cache: yes + when: repo_config_unbound.changed - fail: msg: "Required nsd_addr is missing"