Skip to content

Commit

Permalink
Merge pull request #213 from npmdnl/npmdnl-auth49
Browse files Browse the repository at this point in the history
Added Auth49
  • Loading branch information
npmdnl authored Apr 12, 2024
2 parents 127971a + badd568 commit 90faa40
Show file tree
Hide file tree
Showing 10 changed files with 213 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- pdns-46
- pdns-47
- pdns-48
- pdns-49
- pdns-master
- pdns-os-repos
- systemd-no-overrides
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ By default, the PowerDNS Authoritative Server is installed from the software rep
- hosts: all
roles:
- { role: PowerDNS.pdns,
pdns_install_repo: "{{ pdns_auth_powerdns_repo_47 }}"
pdns_install_repo: "{{ pdns_auth_powerdns_repo_47 }}"

# Install the PowerDNS Authoritative Server from the '4.8.x' official repository
- hosts: all
roles:
- { role: PowerDNS.pdns,
pdns_install_repo: "{{ pdns_auth_powerdns_repo_48 }}"
pdns_install_repo: "{{ pdns_auth_powerdns_repo_48 }}"

# Install the PowerDNS Authoritative Server from the '4.9.x' official repository
- hosts: all
roles:
- { role: PowerDNS.pdns,
pdns_install_repo: "{{ pdns_auth_powerdns_repo_49 }}"
```
The examples above, show how to install the PowerDNS Authoritative Server from the official PowerDNS repositories
Expand Down Expand Up @@ -353,7 +359,7 @@ To test all the scenarios run

To run a custom molecule command

$ tox -e ansible214 -- molecule test -s pdns-48
$ tox -e ansible214 -- molecule test -s pdns-49

## License

Expand Down
9 changes: 9 additions & 0 deletions molecule/pdns-49/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

- hosts: pdns
vars_files:
- ../resources/vars/pdns-common.yml
- ../resources/vars/pdns-repo-49.yml
- ../resources/vars/pdns-backends.yml
roles:
- { role: powerdns.pdns }
119 changes: 119 additions & 0 deletions molecule/pdns-49/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---

scenario:
name: pdns-49

driver:
name: docker

dependency:
name: galaxy

platforms:
- name: centos-7
groups: ["pdns"]
image: centos:7
dockerfile_tpl: centos-systemd

- name: rockylinux-8
groups: ["pdns"]
image: rockylinux:8
dockerfile_tpl: centos-systemd

- name: almalinux-8
groups: ["pdns"]
image: almalinux:8
dockerfile_tpl: centos-systemd

- name: rockylinux-9
groups: ["pdns"]
image: rockylinux:9.0
dockerfile_tpl: centos-systemd

- name: almalinux-9
groups: ["pdns"]
image: almalinux:9
dockerfile_tpl: centos-systemd

- name: oraclelinux-9
groups: ["pdns"]
image: oraclelinux:9
dockerfile_tpl: centos-systemd

- name: oraclelinux-8
groups: ["pdns"]
image: oraclelinux:8
dockerfile_tpl: centos-systemd

- name: ubuntu-2004
groups: ["pdns"]
image: ubuntu:20.04
tmpfs:
- /run
- /tmp
dockerfile_tpl: debian-systemd

- name: debian-10
groups: ["pdns"]
image: debian:10
privileged: True
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
tmpfs:
- /run
- /run/lock
- /tmp
dockerfile_tpl: debian-systemd
environment: { container: docker }

# In order to run the tests we need
# a MySQL container to be up & running
- name: mysql
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: pdns
# Declaring the container as service,
# will link it to the others Platforms containers
# on creation.
is_service: yes

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
# "systemctl used in place of systemd module" "ANSIBLE0006"
# "Tasks that run when changed should likely be handlers" "ANSIBLE0016"
# "Shells that use pipes should set the pipefail option" "306"
lint: ansible-lint -x ANSIBLE0006 ANSIBLE0016 306

lint: yamllint defaults tasks meta vars

verifier:
name: testinfra
options:
hosts: "pdns"
vvv: True
directory: ../resources/tests/all
additional_files_or_dirs:
# path relative to 'directory'
- ../repo-49/
- ../backend-sqlite/
- ../backend-mysql/
- ../systemd-override/

15 changes: 13 additions & 2 deletions molecule/pdns-os-repos/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ dependency:
name: galaxy

platforms:
- name: debian-10
- name: debian-11
groups: ["pdns"]
image: debian:10
image: debian:11
privileged: True
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
tmpfs:
- /run
- /run/lock
- /tmp
dockerfile_tpl: debian-systemd
environment: { container: docker }

- name: archlinux
groups: ["pdns"]
Expand All @@ -23,6 +31,9 @@ platforms:
- name: ubuntu-2004
groups: ["pdns"]
image: ubuntu:20.04
tmpfs:
- /run
- /tmp
dockerfile_tpl: debian-systemd

# In order to run the tests we need
Expand Down
44 changes: 44 additions & 0 deletions molecule/resources/tests/repo-49/test_repo_49 .py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

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-auth-49.list')
if host.system_info.distribution.lower() in rhel_os:
f = host.file('/etc/yum.repos.d/powerdns-auth-49.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-auth-49.list')
if host.system_info.distribution.lower() in rhel_os:
f = host.file('/etc/yum.repos.d/powerdns-auth-49.repo')

assert f.exists
assert f.contains('auth-49')


def test_repo_pinning_file(host):
if host.system_info.distribution.lower() in debian_os:
f = host.file('/etc/apt/preferences.d/pdns')
assert f.exists
assert f.user == 'root'
assert f.group == 'root'
f.contains('Package: pdns-*')
f.contains('Pin: origin repo.powerdns.com')
f.contains('Pin-Priority: 600')


def test_pdns_version(host):
cmd = host.run('/usr/sbin/pdns_server --version')

assert 'PowerDNS Authoritative Server' in cmd.stderr
assert '4.9' in cmd.stderr
2 changes: 1 addition & 1 deletion molecule/resources/vars/pdns-no-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ pdns_config:
webserver-address: "0.0.0.0"
webserver-port: "8001"

pdns_install_repo: "{{ pdns_auth_powerdns_repo_48 }}"
pdns_install_repo: "{{ pdns_auth_powerdns_repo_49 }}"
pdns_service_overrides: ''
2 changes: 1 addition & 1 deletion molecule/resources/vars/pdns-os-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
pdns_config:

# Turns on master operations
master: true
primary: true

# Listen Address
local-address: "127.0.0.1"
Expand Down
7 changes: 7 additions & 0 deletions molecule/resources/vars/pdns-repo-49.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

##
# PowerDNS 4.9.x Repository
##

pdns_install_repo: "{{ pdns_auth_powerdns_repo_49 }}"
9 changes: 9 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ pdns_auth_powerdns_repo_48:
yum_debug_symbols_repo_baseurl: "http://repo.powerdns.com/centos/$basearch/$releasever/auth-48/debug"
name: "powerdns-auth-48"

pdns_auth_powerdns_repo_49:
apt_repo_origin: "repo.powerdns.com"
apt_repo: "deb [arch=amd64] http://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-auth-49 main"
gpg_key: "http://repo.powerdns.com/FD380FBB-pub.asc"
gpg_key_id: "9FAAA5577E8FCF62093D036C1B0C6205FD380FBB"
yum_repo_baseurl: "http://repo.powerdns.com/centos/$basearch/$releasever/auth-49"
yum_debug_symbols_repo_baseurl: "http://repo.powerdns.com/centos/$basearch/$releasever/auth-49/debug"
name: "powerdns-auth-49"


default_pdns_service_overrides: >-
{{ { 'User' : pdns_user
Expand Down

0 comments on commit 90faa40

Please sign in to comment.