diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4db5e6..3553754 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,7 @@ jobs: - pdns-rec-48 - pdns-rec-49 - pdns-rec-50 + - pdns-rec-51 - pdns-rec-master fail-fast: false steps: diff --git a/molecule/pdns-rec-51/converge.yml b/molecule/pdns-rec-51/converge.yml new file mode 100644 index 0000000..6897e75 --- /dev/null +++ b/molecule/pdns-rec-51/converge.yml @@ -0,0 +1,8 @@ +--- + +- hosts: all + vars_files: + - ../resources/vars/pdns-rec-common.yml + - ../resources/vars/pdns-rec-repo-51.yml + roles: + - { role: pdns_recursor-ansible } diff --git a/molecule/pdns-rec-51/molecule.yml b/molecule/pdns-rec-51/molecule.yml new file mode 100644 index 0000000..a99ce1f --- /dev/null +++ b/molecule/pdns-rec-51/molecule.yml @@ -0,0 +1,92 @@ +--- + +scenario: + name: pdns-rec-51 + +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: oraclelinux-9 + image: oraclelinux:9 + 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 + + - name: debian-11 + image: debian:11 + dockerfile_tpl: debian-python3 + + - name: debian-12 + image: debian:12 + dockerfile_tpl: debian-python3 + + - name: rockylinux-8 + image: rockylinux:8 + dockerfile_tpl: centos-systemd + + - name: almalinux-8 + image: almalinux:8 + dockerfile_tpl: centos-systemd + + - name: rockylinux-9 + image: rockylinux:9.0 + dockerfile_tpl: centos-systemd + + - name: almalinux-9 + image: almalinux:9 + dockerfile_tpl: centos-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-51/ + - ../systemd-overrides diff --git a/molecule/resources/tests/repo-51/test_repo_51.py b/molecule/resources/tests/repo-51/test_repo_51.py new file mode 100644 index 0000000..4bf4a6b --- /dev/null +++ b/molecule/resources/tests/repo-51/test_repo_51.py @@ -0,0 +1,41 @@ + +debian_os = ['debian', 'ubuntu'] +rhel_os = ['redhat', 'centos', 'ol', 'rocky', 'almalinux'] + + +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-51.list') + if host.system_info.distribution.lower() in rhel_os: + f = host.file('/etc/yum.repos.d/powerdns-rec-51.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-51.list') + if host.system_info.distribution.lower() in rhel_os: + f = host.file('/etc/yum.repos.d/powerdns-rec-51.repo') + + assert f.exists + assert f.contains('rec-51') + + +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/vars/main.yml b/vars/main.yml index ae97154..854a1ee 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -38,6 +38,15 @@ pdns_rec_powerdns_repo_50: yum_debug_symbols_repo_baseurl: https://repo.powerdns.com/centos/$basearch/$releasever/rec-50/debug name: powerdns-rec-50 +pdns_rec_powerdns_repo_51: + apt_repo_origin: repo.powerdns.com + apt_repo: deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-51 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-51 + yum_debug_symbols_repo_baseurl: https://repo.powerdns.com/centos/$basearch/$releasever/rec-51/debug + name: powerdns-rec-51 + default_pdns_rec_service_overrides: >- {{ { 'User' : pdns_rec_user , 'Group' : pdns_rec_group