-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2911d27
commit 2562e0d
Showing
5 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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=') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters