From 9e13d567f2589acdb62adc012b731b4deaa9d4c6 Mon Sep 17 00:00:00 2001 From: Daniele Petiti Date: Wed, 10 Jan 2024 17:23:52 +0100 Subject: [PATCH 1/4] added rec-50 --- .github/workflows/main.yml | 1 + molecule/pdns-rec-49/molecule.yml | 4 ++ molecule/pdns-rec-50/converge.yml | 8 ++++ molecule/pdns-rec-50/molecule.yml | 72 +++++++++++++++++++++++++++++++ vars/main.yml | 8 ++++ 5 files changed, 93 insertions(+) create mode 100644 molecule/pdns-rec-50/converge.yml create mode 100644 molecule/pdns-rec-50/molecule.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 81affac..74d53bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,7 @@ jobs: - pdns-rec-47 - pdns-rec-48 - pdns-rec-49 + - pdns-rec-50 - pdns-rec-master steps: - name: checkout diff --git a/molecule/pdns-rec-49/molecule.yml b/molecule/pdns-rec-49/molecule.yml index f369590..3f6ed8b 100644 --- a/molecule/pdns-rec-49/molecule.yml +++ b/molecule/pdns-rec-49/molecule.yml @@ -17,6 +17,10 @@ platforms: - name: oraclelinux-8 image: oraclelinux:8 dockerfile_tpl: centos-systemd + + - name: ubi9 + image: redhat/ubi + dockerfile_tpl: centos-systemd - name: ubuntu-1804 image: ubuntu:18.04 diff --git a/molecule/pdns-rec-50/converge.yml b/molecule/pdns-rec-50/converge.yml new file mode 100644 index 0000000..8be83cd --- /dev/null +++ b/molecule/pdns-rec-50/converge.yml @@ -0,0 +1,8 @@ +--- + +- hosts: all + vars_files: + - ../resources/vars/pdns-rec-common.yml + - ../resources/vars/pdns-rec-repo-50.yml + roles: + - { role: pdns_recursor-ansible } diff --git a/molecule/pdns-rec-50/molecule.yml b/molecule/pdns-rec-50/molecule.yml new file mode 100644 index 0000000..fb89a92 --- /dev/null +++ b/molecule/pdns-rec-50/molecule.yml @@ -0,0 +1,72 @@ +--- + +scenario: + name: pdns-rec-50 + +driver: + name: docker + +dependency: + name: galaxy + +platforms: + - name: centos-7 + image: centos:7 + dockerfile_tpl: centos-systemd + + - name: oraclelinux-8 + image: oraclelinux:8 + dockerfile_tpl: centos-systemd + + - name: ubi9 + image: redhat/ubi + dockerfile_tpl: centos-systemd + + - name: ubuntu-1804 + image: ubuntu:18.04 + dockerfile_tpl: ubuntu-systemd + + - name: ubuntu-2004 + image: ubuntu:20.04 + dockerfile_tpl: ubuntu-systemd + + - name: ubuntu-2204 + image: ubuntu:22.04 + dockerfile_tpl: ubuntu-systemd + + - name: debian-10 + image: debian:10 + dockerfile_tpl: debian-systemd + +provisioner: + name: ansible + options: + diff: True + v: True + config_options: + defaults: + gathering: smart + fact_caching: jsonfile + fact_caching_connection: .ansible_cache + fact_caching_timeout: 7200 + ssh_connection: + pipelining: true + inventory: + links: + host_vars: ../resources/host_vars/ + playbooks: + create: ../resources/create.yml + destroy: ../resources/destroy.yml + prepare: ../resources/prepare.yml + lint: ansible-lint -x ANSIBLE0006 ANSIBLE0016 + +lint: yamllint vars tasks defaults meta + +verifier: + name: testinfra + options: + vvv: True + directory: ../resources/tests/all + additional_files_or_dirs: + - ../repo-50/ + - ../systemd-overrides diff --git a/vars/main.yml b/vars/main.yml index fd4f721..e88d4d7 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -38,6 +38,14 @@ pdns_rec_powerdns_repo_49: yum_debug_symbols_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-49/debug" name: "powerdns-rec-49" +pdns_rec_powerdns_repo_50: + apt_repo_origin: "repo.powerdns.com" + apt_repo: "deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-50 main" + gpg_key: "https://repo.powerdns.com/FD380FBB-pub.asc" + gpg_key_id: "9FAAA5577E8FCF62093D036C1B0C6205FD380FBB" + yum_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-50" + yum_debug_symbols_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-50/debug" + name: "powerdns-rec-50" default_pdns_rec_service_overrides: >- From 62c0f46f510c5b6ec9b3a6ad93e113f989005f63 Mon Sep 17 00:00:00 2001 From: Daniele Petiti Date: Wed, 10 Jan 2024 19:26:33 +0100 Subject: [PATCH 2/4] fixes --- molecule/pdns-rec-48/molecule.yml | 1 - molecule/pdns-rec-49/molecule.yml | 5 --- molecule/pdns-rec-50/molecule.yml | 8 ---- .../resources/tests/repo-50/test_repo_50.py | 41 +++++++++++++++++++ molecule/resources/vars/pdns-rec-repo-50.yml | 7 ++++ 5 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 molecule/resources/tests/repo-50/test_repo_50.py create mode 100644 molecule/resources/vars/pdns-rec-repo-50.yml diff --git a/molecule/pdns-rec-48/molecule.yml b/molecule/pdns-rec-48/molecule.yml index a2101c8..c23a015 100644 --- a/molecule/pdns-rec-48/molecule.yml +++ b/molecule/pdns-rec-48/molecule.yml @@ -66,4 +66,3 @@ verifier: additional_files_or_dirs: - ../repo-48/ - ../systemd-overrides - diff --git a/molecule/pdns-rec-49/molecule.yml b/molecule/pdns-rec-49/molecule.yml index 3f6ed8b..15b6975 100644 --- a/molecule/pdns-rec-49/molecule.yml +++ b/molecule/pdns-rec-49/molecule.yml @@ -17,10 +17,6 @@ platforms: - name: oraclelinux-8 image: oraclelinux:8 dockerfile_tpl: centos-systemd - - - name: ubi9 - image: redhat/ubi - dockerfile_tpl: centos-systemd - name: ubuntu-1804 image: ubuntu:18.04 @@ -70,4 +66,3 @@ verifier: additional_files_or_dirs: - ../repo-49/ - ../systemd-overrides - diff --git a/molecule/pdns-rec-50/molecule.yml b/molecule/pdns-rec-50/molecule.yml index fb89a92..54e119b 100644 --- a/molecule/pdns-rec-50/molecule.yml +++ b/molecule/pdns-rec-50/molecule.yml @@ -18,14 +18,6 @@ platforms: image: oraclelinux:8 dockerfile_tpl: centos-systemd - - name: ubi9 - image: redhat/ubi - dockerfile_tpl: centos-systemd - - - name: ubuntu-1804 - image: ubuntu:18.04 - dockerfile_tpl: ubuntu-systemd - - name: ubuntu-2004 image: ubuntu:20.04 dockerfile_tpl: ubuntu-systemd diff --git a/molecule/resources/tests/repo-50/test_repo_50.py b/molecule/resources/tests/repo-50/test_repo_50.py new file mode 100644 index 0000000..235a2a1 --- /dev/null +++ b/molecule/resources/tests/repo-50/test_repo_50.py @@ -0,0 +1,41 @@ + +debian_os = ['debian', 'ubuntu'] +rhel_os = ['redhat', 'centos', 'ol'] + + +def test_repo_file(host): + f = None + if host.system_info.distribution.lower() in debian_os: + f = host.file('/etc/apt/sources.list.d/powerdns-rec-50.list') + if host.system_info.distribution.lower() in rhel_os: + f = host.file('/etc/yum.repos.d/powerdns-rec-50.repo') + + assert f.exists + assert f.user == 'root' + assert f.group == 'root' + + +def test_pdns_repo(host): + f = None + if host.system_info.distribution.lower() in debian_os: + f = host.file('/etc/apt/sources.list.d/powerdns-rec-50.list') + if host.system_info.distribution.lower() in rhel_os: + f = host.file('/etc/yum.repos.d/powerdns-rec-50.repo') + + assert f.exists + assert f.contains('rec-50') + + +def test_pdns_version(host): + cmd = host.run('/usr/sbin/pdns_recursor --version') + + assert 'PowerDNS Recursor' in cmd.stderr + assert '5.0' in cmd.stderr + + +def systemd_override(host): + fname = '/etc/systemd/system/pdns-recursor.service.d/override.conf' + f = host.file(fname) + + assert not f.contains('User=') + assert not f.contains('Group=') diff --git a/molecule/resources/vars/pdns-rec-repo-50.yml b/molecule/resources/vars/pdns-rec-repo-50.yml new file mode 100644 index 0000000..98b0ca6 --- /dev/null +++ b/molecule/resources/vars/pdns-rec-repo-50.yml @@ -0,0 +1,7 @@ +--- + +## +# PowerDNS Recursor 5.0.x Repository +## + +pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_50 }}" \ No newline at end of file From 897ab7857561c2d4228cec0035b77a5bcccedfc8 Mon Sep 17 00:00:00 2001 From: Daniele Petiti Date: Wed, 10 Jan 2024 19:39:09 +0100 Subject: [PATCH 3/4] removed ubuntu1804 for obsolescence --- molecule/pdns-rec-47/molecule.yml | 4 ---- molecule/pdns-rec-48/molecule.yml | 4 ---- molecule/pdns-rec-49/molecule.yml | 4 ---- molecule/pdns-rec-master/molecule.yml | 4 ---- 4 files changed, 16 deletions(-) diff --git a/molecule/pdns-rec-47/molecule.yml b/molecule/pdns-rec-47/molecule.yml index 99ab0ab..1e40103 100644 --- a/molecule/pdns-rec-47/molecule.yml +++ b/molecule/pdns-rec-47/molecule.yml @@ -18,10 +18,6 @@ platforms: image: oraclelinux:8 dockerfile_tpl: centos-systemd - - name: ubuntu-1804 - image: ubuntu:18.04 - dockerfile_tpl: ubuntu-systemd - - name: ubuntu-2004 image: ubuntu:20.04 dockerfile_tpl: ubuntu-systemd diff --git a/molecule/pdns-rec-48/molecule.yml b/molecule/pdns-rec-48/molecule.yml index c23a015..14b71ae 100644 --- a/molecule/pdns-rec-48/molecule.yml +++ b/molecule/pdns-rec-48/molecule.yml @@ -18,10 +18,6 @@ platforms: image: oraclelinux:8 dockerfile_tpl: centos-systemd - - name: ubuntu-1804 - image: ubuntu:18.04 - dockerfile_tpl: ubuntu-systemd - - name: ubuntu-2004 image: ubuntu:20.04 dockerfile_tpl: ubuntu-systemd diff --git a/molecule/pdns-rec-49/molecule.yml b/molecule/pdns-rec-49/molecule.yml index 15b6975..40ee3f6 100644 --- a/molecule/pdns-rec-49/molecule.yml +++ b/molecule/pdns-rec-49/molecule.yml @@ -18,10 +18,6 @@ platforms: image: oraclelinux:8 dockerfile_tpl: centos-systemd - - name: ubuntu-1804 - image: ubuntu:18.04 - dockerfile_tpl: ubuntu-systemd - - name: ubuntu-2004 image: ubuntu:20.04 dockerfile_tpl: ubuntu-systemd diff --git a/molecule/pdns-rec-master/molecule.yml b/molecule/pdns-rec-master/molecule.yml index 9bae64d..18f59b4 100644 --- a/molecule/pdns-rec-master/molecule.yml +++ b/molecule/pdns-rec-master/molecule.yml @@ -18,10 +18,6 @@ platforms: image: oraclelinux:8 dockerfile_tpl: centos-systemd - - name: ubuntu-1804 - image: ubuntu:18.04 - dockerfile_tpl: ubuntu-systemd - - name: ubuntu-2004 image: ubuntu:20.04 dockerfile_tpl: ubuntu-systemd From 341467e8d572879872070c9e5fb094710da8bad4 Mon Sep 17 00:00:00 2001 From: Daniele Petiti Date: Wed, 10 Jan 2024 19:51:05 +0100 Subject: [PATCH 4/4] removing rec47 --- .github/workflows/main.yml | 1 - README.md | 12 ++-- molecule/pdns-rec-47/converge.yml | 8 --- molecule/pdns-rec-47/molecule.yml | 64 ------------------- .../resources/tests/repo-47/test_repo_47.py | 41 ------------ vars/main.yml | 9 --- 6 files changed, 6 insertions(+), 129 deletions(-) delete mode 100644 molecule/pdns-rec-47/converge.yml delete mode 100644 molecule/pdns-rec-47/molecule.yml delete mode 100644 molecule/resources/tests/repo-47/test_repo_47.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 74d53bd..0d7dbce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,6 @@ jobs: - "2.13" - "2.14" scenario: - - pdns-rec-47 - pdns-rec-48 - pdns-rec-49 - pdns-rec-50 diff --git a/README.md b/README.md index bf3be62..a49494d 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,6 @@ By default, the PowerDNS Recursor is installed from the software repositories co - { role: PowerDNS.pdns_recursor, pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_master }}" } -# Install the PowerDNS Recursor from the '4.7.x' official repository -- hosts: pdns-recursors - roles: - - { role: PowerDNS.pdns_recursor, - pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_47 }}" } - # Install the PowerDNS Recursor from the '4.8.x' official repository - hosts: pdns-recursors roles: @@ -49,6 +43,12 @@ By default, the PowerDNS Recursor is installed from the software repositories co roles: - { role: PowerDNS.pdns_recursor, pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_49 }}" } + +# Install the PowerDNS Recursor from the '5.0.x' official repository +- hosts: pdns-recursors + roles: + - { role: PowerDNS.pdns_recursor, + pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_50 }}" } ``` The examples above, show how to install the PowerDNS Recursor from the official PowerDNS repositories diff --git a/molecule/pdns-rec-47/converge.yml b/molecule/pdns-rec-47/converge.yml deleted file mode 100644 index 52ac257..0000000 --- a/molecule/pdns-rec-47/converge.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- hosts: all - vars_files: - - ../resources/vars/pdns-rec-common.yml - - ../resources/vars/pdns-rec-repo-47.yml - roles: - - { role: pdns_recursor-ansible } diff --git a/molecule/pdns-rec-47/molecule.yml b/molecule/pdns-rec-47/molecule.yml deleted file mode 100644 index 1e40103..0000000 --- a/molecule/pdns-rec-47/molecule.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- - -scenario: - name: pdns-rec-47 - -driver: - name: docker - -dependency: - name: galaxy - -platforms: - - name: centos-7 - image: centos:7 - dockerfile_tpl: centos-systemd - - - name: oraclelinux-8 - image: oraclelinux:8 - dockerfile_tpl: centos-systemd - - - name: ubuntu-2004 - image: ubuntu:20.04 - dockerfile_tpl: ubuntu-systemd - - - name: ubuntu-2204 - image: ubuntu:22.04 - dockerfile_tpl: ubuntu-systemd - - - name: debian-10 - image: debian:10 - dockerfile_tpl: debian-systemd - -provisioner: - name: ansible - options: - diff: True - v: True - config_options: - defaults: - gathering: smart - fact_caching: jsonfile - fact_caching_connection: .ansible_cache - fact_caching_timeout: 7200 - ssh_connection: - pipelining: true - inventory: - links: - host_vars: ../resources/host_vars/ - playbooks: - create: ../resources/create.yml - destroy: ../resources/destroy.yml - prepare: ../resources/prepare.yml - lint: ansible-lint -x ANSIBLE0006 ANSIBLE0016 - -lint: yamllint vars tasks defaults meta - -verifier: - name: testinfra - options: - vvv: True - directory: ../resources/tests/all - additional_files_or_dirs: - - ../repo-47/ - - ../systemd-overrides diff --git a/molecule/resources/tests/repo-47/test_repo_47.py b/molecule/resources/tests/repo-47/test_repo_47.py deleted file mode 100644 index 05912ff..0000000 --- a/molecule/resources/tests/repo-47/test_repo_47.py +++ /dev/null @@ -1,41 +0,0 @@ - -debian_os = ['debian', 'ubuntu'] -rhel_os = ['redhat', 'centos', 'ol'] - - -def test_repo_file(host): - f = None - if host.system_info.distribution.lower() in debian_os: - f = host.file('/etc/apt/sources.list.d/powerdns-rec-47.list') - if host.system_info.distribution.lower() in rhel_os: - f = host.file('/etc/yum.repos.d/powerdns-rec-47.repo') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' - - -def test_pdns_repo(host): - f = None - if host.system_info.distribution.lower() in debian_os: - f = host.file('/etc/apt/sources.list.d/powerdns-rec-47.list') - if host.system_info.distribution.lower() in rhel_os: - f = host.file('/etc/yum.repos.d/powerdns-rec-47.repo') - - assert f.exists - assert f.contains('rec-47') - - -def test_pdns_version(host): - cmd = host.run('/usr/sbin/pdns_recursor --version') - - assert 'PowerDNS Recursor' in cmd.stderr - assert '4.7' in cmd.stderr - - -def systemd_override(host): - fname = '/etc/systemd/system/pdns-recursor.service.d/override.conf' - f = host.file(fname) - - assert not f.contains('User=') - assert not f.contains('Group=') diff --git a/vars/main.yml b/vars/main.yml index e88d4d7..385b8d2 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -11,15 +11,6 @@ pdns_rec_powerdns_repo_master: yum_debug_symbols_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-master/debug" name: "powerdns-rec-master" -pdns_rec_powerdns_repo_47: - apt_repo_origin: "repo.powerdns.com" - apt_repo: "deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-47 main" - gpg_key: "https://repo.powerdns.com/FD380FBB-pub.asc" - gpg_key_id: "9FAAA5577E8FCF62093D036C1B0C6205FD380FBB" - yum_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-47" - yum_debug_symbols_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-47/debug" - name: "powerdns-rec-47" - pdns_rec_powerdns_repo_48: apt_repo_origin: "repo.powerdns.com" apt_repo: "deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-48 main"