From 3c40aa44bc023b5e085fa2a56c96daf9c7cffec4 Mon Sep 17 00:00:00 2001 From: Daniele Petiti Date: Fri, 20 Jan 2023 16:06:20 +0100 Subject: [PATCH 1/2] Removed EOL versions and updated workflows as well --- .github/workflows/main.yml | 11 ++- README.md | 14 ++-- .../pdns-rec-43-no-sd-overrides/converge.yml | 8 --- .../pdns-rec-43-no-sd-overrides/molecule.yml | 66 ----------------- molecule/pdns-rec-43/converge.yml | 8 --- molecule/pdns-rec-43/molecule.yml | 67 ----------------- molecule/pdns-rec-44/converge.yml | 8 --- molecule/pdns-rec-44/molecule.yml | 71 ------------------- molecule/pdns-rec-45/converge.yml | 8 --- molecule/pdns-rec-45/molecule.yml | 67 ----------------- .../resources/tests/repo-43/test_repo_43.py | 41 ----------- .../resources/tests/repo-44/test_repo_44.py | 41 ----------- .../resources/tests/repo-45/test_repo_45.py | 41 ----------- molecule/resources/vars/pdns-rec-repo-43.yml | 7 -- molecule/resources/vars/pdns-rec-repo-44.yml | 7 -- molecule/resources/vars/pdns-rec-repo-45.yml | 7 -- vars/main.yml | 36 +++------- 17 files changed, 21 insertions(+), 487 deletions(-) delete mode 100644 molecule/pdns-rec-43-no-sd-overrides/converge.yml delete mode 100644 molecule/pdns-rec-43-no-sd-overrides/molecule.yml delete mode 100644 molecule/pdns-rec-43/converge.yml delete mode 100644 molecule/pdns-rec-43/molecule.yml delete mode 100644 molecule/pdns-rec-44/converge.yml delete mode 100644 molecule/pdns-rec-44/molecule.yml delete mode 100644 molecule/pdns-rec-45/converge.yml delete mode 100644 molecule/pdns-rec-45/molecule.yml delete mode 100644 molecule/resources/tests/repo-43/test_repo_43.py delete mode 100644 molecule/resources/tests/repo-44/test_repo_44.py delete mode 100644 molecule/resources/tests/repo-45/test_repo_45.py delete mode 100644 molecule/resources/vars/pdns-rec-repo-43.yml delete mode 100644 molecule/resources/vars/pdns-rec-repo-44.yml delete mode 100644 molecule/resources/vars/pdns-rec-repo-45.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bc3dfe6..90b4ebf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,15 +10,14 @@ jobs: strategy: matrix: ansible: - - '2.9' - - '2.10' - '2.11' + - '2.12' + - '2.13' scenario: - - pdns-rec-43 - - pdns-rec-44 - - pdns-rec-45 + - pdns-rec-46 + - pdns-rec-47 + - pdns-rec-48 - pdns-rec-master - - pdns-rec-43-no-sd-overrides steps: - name: checkout uses: actions/checkout@v3 diff --git a/README.md b/README.md index e2c5456..1b3b3f8 100644 --- a/README.md +++ b/README.md @@ -32,23 +32,23 @@ 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.3.x' official repository +# Install the PowerDNS Recursor from the '4.6.x' official repository - hosts: pdns-recursors roles: - { role: PowerDNS.pdns_recursor, - pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_43 }}" } + pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_46 }}" } -# Install the PowerDNS Recursor from the '4.4.x' official repository +# 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_44 }}" } + pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_47 }}" } -# Install the PowerDNS Recursor from the '4.5.x' official repository +# Install the PowerDNS Recursor from the '4.8.x' official repository - hosts: pdns-recursors roles: - { role: PowerDNS.pdns_recursor, - pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_45 }}" } + pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_48 }}" } ``` The examples above, show how to install the PowerDNS Recursor from the official PowerDNS repositories @@ -258,7 +258,7 @@ To test all the scenarios run To run a custom molecule command - $ tox -e ansible210 -- molecule test -s pdns-rec-45 + $ tox -e ansible210 -- molecule test -s pdns-rec-48 ## License diff --git a/molecule/pdns-rec-43-no-sd-overrides/converge.yml b/molecule/pdns-rec-43-no-sd-overrides/converge.yml deleted file mode 100644 index 4e2bfc2..0000000 --- a/molecule/pdns-rec-43-no-sd-overrides/converge.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- hosts: all - vars_files: - - ../resources/vars/pdns-rec-no-overrides.yml - - ../resources/vars/pdns-rec-repo-43.yml - roles: - - { role: pdns_recursor-ansible } diff --git a/molecule/pdns-rec-43-no-sd-overrides/molecule.yml b/molecule/pdns-rec-43-no-sd-overrides/molecule.yml deleted file mode 100644 index 1b86561..0000000 --- a/molecule/pdns-rec-43-no-sd-overrides/molecule.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- - -scenario: - name: pdns-rec-43-no-sd-overrides - -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: debian-systemd - - - name: debian-9 - image: debian:9 - dockerfile_tpl: debian-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 - # ANSIBLE0006 "systemctl used in place of systemd module" - # ANSIBLE0016 "Tasks that run when changed should likely be handlers" - 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: - - ../no-systemd-overrides - lint: flake8 diff --git a/molecule/pdns-rec-43/converge.yml b/molecule/pdns-rec-43/converge.yml deleted file mode 100644 index 40a1bed..0000000 --- a/molecule/pdns-rec-43/converge.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- hosts: all - vars_files: - - ../resources/vars/pdns-rec-common.yml - - ../resources/vars/pdns-rec-repo-43.yml - roles: - - { role: pdns_recursor-ansible } diff --git a/molecule/pdns-rec-43/molecule.yml b/molecule/pdns-rec-43/molecule.yml deleted file mode 100644 index c748fea..0000000 --- a/molecule/pdns-rec-43/molecule.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- - -scenario: - name: pdns-rec-43 - -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: debian-systemd - - - name: debian-9 - image: debian:9 - dockerfile_tpl: debian-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 - # ANSIBLE0006 "systemctl used in place of systemd module" - # ANSIBLE0016 "Tasks that run when changed should likely be handlers" - 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-43/ - - ../systemd-overrides - lint: flake8 diff --git a/molecule/pdns-rec-44/converge.yml b/molecule/pdns-rec-44/converge.yml deleted file mode 100644 index 24778b7..0000000 --- a/molecule/pdns-rec-44/converge.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- hosts: all - vars_files: - - ../resources/vars/pdns-rec-common.yml - - ../resources/vars/pdns-rec-repo-44.yml - roles: - - { role: pdns_recursor-ansible } diff --git a/molecule/pdns-rec-44/molecule.yml b/molecule/pdns-rec-44/molecule.yml deleted file mode 100644 index 9346685..0000000 --- a/molecule/pdns-rec-44/molecule.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- - -scenario: - name: pdns-rec-44 - -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-1804 - image: ubuntu:18.04 - dockerfile_tpl: debian-systemd - - - name: ubuntu-2004 - image: ubuntu:20.04 - dockerfile_tpl: debian-systemd - - - name: debian-9 - image: debian:9 - dockerfile_tpl: debian-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 - # ANSIBLE0006 "systemctl used in place of systemd module" - # ANSIBLE0016 "Tasks that run when changed should likely be handlers" - 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-44/ - - ../systemd-overrides - lint: flake8 diff --git a/molecule/pdns-rec-45/converge.yml b/molecule/pdns-rec-45/converge.yml deleted file mode 100644 index 44707f4..0000000 --- a/molecule/pdns-rec-45/converge.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- hosts: all - vars_files: - - ../resources/vars/pdns-rec-common.yml - - ../resources/vars/pdns-rec-repo-45.yml - roles: - - { role: pdns_recursor-ansible } diff --git a/molecule/pdns-rec-45/molecule.yml b/molecule/pdns-rec-45/molecule.yml deleted file mode 100644 index 575b253..0000000 --- a/molecule/pdns-rec-45/molecule.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- - -scenario: - name: pdns-rec-45 - -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-1804 - image: ubuntu:18.04 - dockerfile_tpl: debian-systemd - - - name: ubuntu-2004 - image: ubuntu:20.04 - dockerfile_tpl: debian-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 - # ANSIBLE0006 "systemctl used in place of systemd module" - # ANSIBLE0016 "Tasks that run when changed should likely be handlers" - 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-45/ - - ../systemd-overrides - lint: flake8 diff --git a/molecule/resources/tests/repo-43/test_repo_43.py b/molecule/resources/tests/repo-43/test_repo_43.py deleted file mode 100644 index 02d3d15..0000000 --- a/molecule/resources/tests/repo-43/test_repo_43.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-43.list') - if host.system_info.distribution.lower() in rhel_os: - f = host.file('/etc/yum.repos.d/powerdns-rec-43.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-43.list') - if host.system_info.distribution.lower() in rhel_os: - f = host.file('/etc/yum.repos.d/powerdns-rec-43.repo') - - assert f.exists - assert f.contains('rec-43') - - -def test_pdns_version(host): - cmd = host.run('/usr/sbin/pdns_recursor --version') - - assert 'PowerDNS Recursor' in cmd.stderr - assert '4.3' in cmd.stderr - - -def systemd_override(host): - fname = '/etc/systemd/system/pdns-recursor.service.d/override.conf' - f = host.file(fname) - - assert f.contains('User=') - assert f.contains('Group=') diff --git a/molecule/resources/tests/repo-44/test_repo_44.py b/molecule/resources/tests/repo-44/test_repo_44.py deleted file mode 100644 index c5d8822..0000000 --- a/molecule/resources/tests/repo-44/test_repo_44.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-44.list') - if host.system_info.distribution.lower() in rhel_os: - f = host.file('/etc/yum.repos.d/powerdns-rec-44.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-44.list') - if host.system_info.distribution.lower() in rhel_os: - f = host.file('/etc/yum.repos.d/powerdns-rec-44.repo') - - assert f.exists - assert f.contains('rec-44') - - -def test_pdns_version(host): - cmd = host.run('/usr/sbin/pdns_recursor --version') - - assert 'PowerDNS Recursor' in cmd.stderr - assert '4.4' in cmd.stderr - - -def systemd_override(host): - fname = '/etc/systemd/system/pdns-recursor.service.d/override.conf' - f = host.file(fname) - - assert f.contains('User=') - assert f.contains('Group=') diff --git a/molecule/resources/tests/repo-45/test_repo_45.py b/molecule/resources/tests/repo-45/test_repo_45.py deleted file mode 100644 index 460bd2d..0000000 --- a/molecule/resources/tests/repo-45/test_repo_45.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-45.list') - if host.system_info.distribution.lower() in rhel_os: - f = host.file('/etc/yum.repos.d/powerdns-rec-45.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-45.list') - if host.system_info.distribution.lower() in rhel_os: - f = host.file('/etc/yum.repos.d/powerdns-rec-45.repo') - - assert f.exists - assert f.contains('rec-45') - - -def test_pdns_version(host): - cmd = host.run('/usr/sbin/pdns_recursor --version') - - assert 'PowerDNS Recursor' in cmd.stderr - assert '4.5' 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-43.yml b/molecule/resources/vars/pdns-rec-repo-43.yml deleted file mode 100644 index f45033b..0000000 --- a/molecule/resources/vars/pdns-rec-repo-43.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -## -# PowerDNS Recursor 4.2.x Repository -## - -pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_43 }}" diff --git a/molecule/resources/vars/pdns-rec-repo-44.yml b/molecule/resources/vars/pdns-rec-repo-44.yml deleted file mode 100644 index 9bab1eb..0000000 --- a/molecule/resources/vars/pdns-rec-repo-44.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -## -# PowerDNS Recursor 4.4.x Repository -## - -pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_44 }}" diff --git a/molecule/resources/vars/pdns-rec-repo-45.yml b/molecule/resources/vars/pdns-rec-repo-45.yml deleted file mode 100644 index 20dee0b..0000000 --- a/molecule/resources/vars/pdns-rec-repo-45.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -## -# PowerDNS Recursor 4.5.x Repository -## - -pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_45 }}" diff --git a/vars/main.yml b/vars/main.yml index 0b412ce..e8d47de 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -11,33 +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_43: - apt_repo_origin: "repo.powerdns.com" - apt_repo: "deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-43 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-43" - yum_debug_symbols_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-43/debug" - name: "powerdns-rec-43" - -pdns_rec_powerdns_repo_44: - apt_repo_origin: "repo.powerdns.com" - apt_repo: "deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-44 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-44" - yum_debug_symbols_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-44/debug" - name: "powerdns-rec-44" - -pdns_rec_powerdns_repo_45: - apt_repo_origin: "repo.powerdns.com" - apt_repo: "deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-45 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-45" - yum_debug_symbols_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-45/debug" - name: "powerdns-rec-45" - pdns_rec_powerdns_repo_46: apt_repo_origin: "repo.powerdns.com" apt_repo: "deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-46 main" @@ -56,6 +29,15 @@ pdns_rec_powerdns_repo_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" + gpg_key: "https://repo.powerdns.com/FD380FBB-pub.asc" + gpg_key_id: "9FAAA5577E8FCF62093D036C1B0C6205FD380FBB" + yum_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-48" + yum_debug_symbols_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-48/debug" + name: "powerdns-rec-48" + default_pdns_rec_service_overrides: >- {{ { 'User' : pdns_rec_user From 9c6f9b3c0787edc8e4ea6758ded40a833eaf77cc Mon Sep 17 00:00:00 2001 From: Daniele Petiti Date: Fri, 20 Jan 2023 16:14:48 +0100 Subject: [PATCH 2/2] forgotten dirs --- molecule/pdns-rec-46/converge.yml | 8 +++ molecule/pdns-rec-46/molecule.yml | 67 +++++++++++++++++++ molecule/pdns-rec-47/converge.yml | 8 +++ molecule/pdns-rec-47/molecule.yml | 67 +++++++++++++++++++ molecule/pdns-rec-48/converge.yml | 8 +++ molecule/pdns-rec-48/molecule.yml | 67 +++++++++++++++++++ .../resources/tests/repo-46/test_repo_46.py | 41 ++++++++++++ .../resources/tests/repo-47/test_repo_47.py | 41 ++++++++++++ .../resources/tests/repo-48/test_repo_48.py | 41 ++++++++++++ molecule/resources/vars/pdns-rec-repo-46.yml | 7 ++ molecule/resources/vars/pdns-rec-repo-47.yml | 7 ++ molecule/resources/vars/pdns-rec-repo-48.yml | 7 ++ 12 files changed, 369 insertions(+) create mode 100644 molecule/pdns-rec-46/converge.yml create mode 100644 molecule/pdns-rec-46/molecule.yml create mode 100644 molecule/pdns-rec-47/converge.yml create mode 100644 molecule/pdns-rec-47/molecule.yml create mode 100644 molecule/pdns-rec-48/converge.yml create mode 100644 molecule/pdns-rec-48/molecule.yml create mode 100644 molecule/resources/tests/repo-46/test_repo_46.py create mode 100644 molecule/resources/tests/repo-47/test_repo_47.py create mode 100644 molecule/resources/tests/repo-48/test_repo_48.py create mode 100644 molecule/resources/vars/pdns-rec-repo-46.yml create mode 100644 molecule/resources/vars/pdns-rec-repo-47.yml create mode 100644 molecule/resources/vars/pdns-rec-repo-48.yml diff --git a/molecule/pdns-rec-46/converge.yml b/molecule/pdns-rec-46/converge.yml new file mode 100644 index 0000000..1238480 --- /dev/null +++ b/molecule/pdns-rec-46/converge.yml @@ -0,0 +1,8 @@ +--- + +- hosts: all + vars_files: + - ../resources/vars/pdns-rec-common.yml + - ../resources/vars/pdns-rec-repo-46.yml + roles: + - { role: pdns_recursor-ansible } diff --git a/molecule/pdns-rec-46/molecule.yml b/molecule/pdns-rec-46/molecule.yml new file mode 100644 index 0000000..dcdd7ce --- /dev/null +++ b/molecule/pdns-rec-46/molecule.yml @@ -0,0 +1,67 @@ +--- + +scenario: + name: pdns-rec-46 + +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-1804 + image: ubuntu:18.04 + dockerfile_tpl: debian-systemd + + - name: ubuntu-2004 + image: ubuntu:20.04 + dockerfile_tpl: debian-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 + # ANSIBLE0006 "systemctl used in place of systemd module" + # ANSIBLE0016 "Tasks that run when changed should likely be handlers" + 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-46/ + - ../systemd-overrides + lint: flake8 diff --git a/molecule/pdns-rec-47/converge.yml b/molecule/pdns-rec-47/converge.yml new file mode 100644 index 0000000..52ac257 --- /dev/null +++ b/molecule/pdns-rec-47/converge.yml @@ -0,0 +1,8 @@ +--- + +- 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 new file mode 100644 index 0000000..92f9b7b --- /dev/null +++ b/molecule/pdns-rec-47/molecule.yml @@ -0,0 +1,67 @@ +--- + +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-1804 + image: ubuntu:18.04 + dockerfile_tpl: debian-systemd + + - name: ubuntu-2004 + image: ubuntu:20.04 + dockerfile_tpl: debian-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 + # ANSIBLE0006 "systemctl used in place of systemd module" + # ANSIBLE0016 "Tasks that run when changed should likely be handlers" + 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 + lint: flake8 diff --git a/molecule/pdns-rec-48/converge.yml b/molecule/pdns-rec-48/converge.yml new file mode 100644 index 0000000..fc9f586 --- /dev/null +++ b/molecule/pdns-rec-48/converge.yml @@ -0,0 +1,8 @@ +--- + +- hosts: all + vars_files: + - ../resources/vars/pdns-rec-common.yml + - ../resources/vars/pdns-rec-repo-48.yml + roles: + - { role: pdns_recursor-ansible } diff --git a/molecule/pdns-rec-48/molecule.yml b/molecule/pdns-rec-48/molecule.yml new file mode 100644 index 0000000..a40b51d --- /dev/null +++ b/molecule/pdns-rec-48/molecule.yml @@ -0,0 +1,67 @@ +--- + +scenario: + name: pdns-rec-48 + +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-1804 + image: ubuntu:18.04 + dockerfile_tpl: debian-systemd + + - name: ubuntu-2004 + image: ubuntu:20.04 + dockerfile_tpl: debian-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 + # ANSIBLE0006 "systemctl used in place of systemd module" + # ANSIBLE0016 "Tasks that run when changed should likely be handlers" + 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-48/ + - ../systemd-overrides + lint: flake8 diff --git a/molecule/resources/tests/repo-46/test_repo_46.py b/molecule/resources/tests/repo-46/test_repo_46.py new file mode 100644 index 0000000..2e34141 --- /dev/null +++ b/molecule/resources/tests/repo-46/test_repo_46.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-46.list') + if host.system_info.distribution.lower() in rhel_os: + f = host.file('/etc/yum.repos.d/powerdns-rec-46.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-46.list') + if host.system_info.distribution.lower() in rhel_os: + f = host.file('/etc/yum.repos.d/powerdns-rec-46.repo') + + assert f.exists + assert f.contains('rec-46') + + +def test_pdns_version(host): + cmd = host.run('/usr/sbin/pdns_recursor --version') + + assert 'PowerDNS Recursor' in cmd.stderr + assert '4.6' 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/tests/repo-47/test_repo_47.py b/molecule/resources/tests/repo-47/test_repo_47.py new file mode 100644 index 0000000..05912ff --- /dev/null +++ b/molecule/resources/tests/repo-47/test_repo_47.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-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/molecule/resources/tests/repo-48/test_repo_48.py b/molecule/resources/tests/repo-48/test_repo_48.py new file mode 100644 index 0000000..dd7d200 --- /dev/null +++ b/molecule/resources/tests/repo-48/test_repo_48.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-48.list') + if host.system_info.distribution.lower() in rhel_os: + f = host.file('/etc/yum.repos.d/powerdns-rec-48.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-48.list') + if host.system_info.distribution.lower() in rhel_os: + f = host.file('/etc/yum.repos.d/powerdns-rec-48.repo') + + assert f.exists + assert f.contains('rec-48') + + +def test_pdns_version(host): + cmd = host.run('/usr/sbin/pdns_recursor --version') + + assert 'PowerDNS Recursor' in cmd.stderr + assert '4.8' 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-46.yml b/molecule/resources/vars/pdns-rec-repo-46.yml new file mode 100644 index 0000000..870b6e7 --- /dev/null +++ b/molecule/resources/vars/pdns-rec-repo-46.yml @@ -0,0 +1,7 @@ +--- + +## +# PowerDNS Recursor 4.6.x Repository +## + +pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_46 }}" diff --git a/molecule/resources/vars/pdns-rec-repo-47.yml b/molecule/resources/vars/pdns-rec-repo-47.yml new file mode 100644 index 0000000..fa51036 --- /dev/null +++ b/molecule/resources/vars/pdns-rec-repo-47.yml @@ -0,0 +1,7 @@ +--- + +## +# PowerDNS Recursor 4.7.x Repository +## + +pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_47 }}" diff --git a/molecule/resources/vars/pdns-rec-repo-48.yml b/molecule/resources/vars/pdns-rec-repo-48.yml new file mode 100644 index 0000000..873fb94 --- /dev/null +++ b/molecule/resources/vars/pdns-rec-repo-48.yml @@ -0,0 +1,7 @@ +--- + +## +# PowerDNS Recursor 4.8.x Repository +## + +pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_48 }}"