-
Notifications
You must be signed in to change notification settings - Fork 127
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
2cb0e02
commit 4110a48
Showing
6 changed files
with
147 additions
and
4 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
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,9 @@ | ||
--- | ||
|
||
- hosts: pdns | ||
vars_files: | ||
- ../resources/vars/pdns-common.yml | ||
- ../resources/vars/pdns-repo-43.yml | ||
- ../resources/vars/pdns-backends.yml | ||
roles: | ||
- { role: pdns-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,93 @@ | ||
--- | ||
|
||
scenario: | ||
name: pdns-43 | ||
|
||
driver: | ||
name: docker | ||
|
||
dependency: | ||
name: galaxy | ||
|
||
platforms: | ||
- name: centos-6 | ||
groups: ["pdns"] | ||
image: centos:6 | ||
|
||
- name: centos-7 | ||
groups: ["pdns"] | ||
image: centos:7 | ||
dockerfile_tpl: centos-systemd | ||
|
||
# Temporarely disable CentOS 8 due to: | ||
# https://github.com/ansible/ansible/issues/64963 | ||
# - name: centos-8 | ||
# groups: ["pdns"] | ||
# image: centos:8 | ||
# dockerfile_tpl: centos-systemd | ||
|
||
- name: ubuntu-1804 | ||
groups: ["pdns"] | ||
image: ubuntu:18.04 | ||
dockerfile_tpl: debian-systemd | ||
|
||
- name: debian-9 | ||
groups: ["pdns"] | ||
image: debian:9 | ||
dockerfile_tpl: debian-systemd | ||
|
||
- name: debian-10 | ||
groups: ["pdns"] | ||
image: debian:10 | ||
dockerfile_tpl: debian-systemd | ||
|
||
# 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-43/ | ||
- ../backend-sqlite/ | ||
- ../backend-mysql/ | ||
lint: flake8 |
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,33 @@ | ||
|
||
debian_os = ['debian', 'ubuntu'] | ||
rhel_os = ['redhat', 'centos'] | ||
|
||
|
||
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-43.list') | ||
if host.system_info.distribution.lower() in rhel_os: | ||
f = host.file('/etc/yum.repos.d/powerdns-auth-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-auth-43.list') | ||
if host.system_info.distribution.lower() in rhel_os: | ||
f = host.file('/etc/yum.repos.d/powerdns-auth-43.repo') | ||
|
||
assert f.exists | ||
assert f.contains('auth-43') | ||
|
||
|
||
def test_pdns_version(host): | ||
cmd = host.run('/usr/sbin/pdns_server --version') | ||
|
||
assert 'PowerDNS Authoritative Server' in cmd.stderr | ||
assert '4.3' in cmd.stderr |
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,7 @@ | ||
--- | ||
|
||
## | ||
# PowerDNS 4.3.x Repository | ||
## | ||
|
||
pdns_install_repo: "{{ pdns_auth_powerdns_repo_43 }}" |