-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add postgresql credentials variable in README.md Flag for creating or use existing DB Add install-dependencies.yml tasks in main.yml
- Loading branch information
dtrdnk
committed
Jun 16, 2024
1 parent
a0eddd4
commit 7aa4ef2
Showing
24 changed files
with
400 additions
and
23 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
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
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 |
---|---|---|
@@ -1,7 +1,17 @@ | ||
--- | ||
- hosts: pdns | ||
vars_files: | ||
- ../resources/vars/pdns-os-repos.yml | ||
- ../resources/vars/pdns-backends.yml | ||
pre_tasks: | ||
- name: "Include variables for Arch" | ||
include_vars: | ||
file: ../resources/vars/pdns-os-repos-arch.yml | ||
when: ansible_os_family == 'Archlinux' | ||
|
||
- name: "Include variables for Debian/Ubuntu" | ||
include_vars: | ||
file: ../resources/vars/pdns-os-repos-debian.yml | ||
when: ansible_os_family == 'Debian' | ||
|
||
roles: | ||
- { role: powerdns.pdns } |
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
44 changes: 44 additions & 0 deletions
44
molecule/resources/tests/backend-pgsql/test_backend_pgsql.py
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,44 @@ | ||
|
||
debian_os = ['debian', 'ubuntu'] | ||
rhel_os = ['redhat', 'centos', 'ol', 'rocky', 'almalinux'] | ||
archlinux_os = ['arch'] | ||
|
||
|
||
def test_package_rhel(host): | ||
if host.system_info.distribution.lower() in rhel_os: | ||
p = host.package('pdns-backend-postgresql') | ||
assert p.is_installed | ||
|
||
def test_package_debian(host): | ||
if host.system_info.distribution.lower() in debian_os: | ||
p = host.package('pdns-backend-pgsql') | ||
assert p.is_installed | ||
|
||
|
||
def test_config(host): | ||
with host.sudo(): | ||
f = None | ||
if host.system_info.distribution.lower() in debian_os + archlinux_os: | ||
f = host.file('/etc/powerdns/pdns.conf') | ||
if host.system_info.distribution.lower() in rhel_os: | ||
f = host.file('/etc/pdns/pdns.conf') | ||
|
||
dbname = host.check_output('hostname -s').replace('.', '_') | ||
|
||
assert f.exists | ||
assert f.contains('launch+=gpgsql') | ||
assert f.contains('gpgsql-host=pgsql') | ||
assert f.contains('gpgsql-password=pdns') | ||
assert f.contains('gpgsql-dbname=' + dbname) | ||
assert f.contains('gpgsql-user=pdns') | ||
|
||
|
||
def test_database_tables(host): | ||
dbname = host.check_output('hostname -s').replace('.', '_') | ||
|
||
cmd = host.run("PGPASSWORD=\"pdns\" psql --dbname \"%s\" --username=\"pdns\" --host=\"pgsql\" " % dbname + | ||
"--command=\"SELECT DISTINCT tablename FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname != 'information_schema'\"") | ||
|
||
for table in [ 'domains', 'records', 'supermasters', 'comments', | ||
'domainmetadata', 'cryptokeys', 'tsigkeys' ]: | ||
assert table in cmd.stdout |
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,26 @@ | ||
--- | ||
|
||
## | ||
# PowerDNS Configuration | ||
## | ||
|
||
pdns_config: | ||
|
||
# Turns on primary operations | ||
primary: true | ||
|
||
# Listen Address | ||
local-address: "127.0.0.1" | ||
local-port: "53" | ||
|
||
# API Configuration | ||
api: yes | ||
api-key: "powerdns" | ||
|
||
# Embedded webserver | ||
webserver: yes | ||
webserver-address: "0.0.0.0" | ||
webserver-port: "8001" | ||
|
||
pdns_service_overrides: | ||
LimitCORE: infinity |
File renamed without changes.
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
collections: | ||
- name: community.mysql | ||
- name: community.postgresql | ||
- name: community.general | ||
- name: community.docker | ||
- name: ansible.posix |
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
Oops, something went wrong.