Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved test-suite and packages installation #47

Merged
merged 11 commits into from
Apr 5, 2018
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

### Python ###
# Byte-compiled / optimized / DLL files
.pytest_cache/
__pycache__/
*.py[cod]
*$py.class
Expand Down
15 changes: 12 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ sudo: required
services:
- docker

# Install molecule and docker-py
# Parallel testing of the supported
# Ansible versions
env:
matrix:
- ANSIBLE=2.2
- ANSIBLE=2.3
- ANSIBLE=2.4
- ANSIBLE=2.5

# Install tox
install:
- pip install tox-travis

# Test all the scenarios against the Ansible versions defined in the tox.ini file
# Test the current PowerDNS Authoritative Server stable release
script:
- tox
- tox -- molecule test -s pdns-41

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
17 changes: 7 additions & 10 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
extends: default

rules:

# Disable line-length and truthy values reporting
line-length: disable
truthy: disable

# Max 1 space to separate the elements in brakets
braces:
max-spaces-inside: 1

# Max 1 space in empty brackets
level: error
brackets:
min-spaces-inside-empty: 0
max-spaces-inside-empty: 1
max-spaces-inside: 1
level: error
line-length: disable
# NOTE(retr0h): Templates no longer fail this lint rule.
# Uncomment if running old Molecule templates.
# truthy: disable
55 changes: 32 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@ Available variables are listed below, along with their default values (see `defa

pdns_install_repo: ""

By default, no PowerDNS repository will be configured by this role.
You can install the PowerDNS packages from the official PowerDNS
By default, no PowerDNS Authoritative Server repository will be configured by this role.
You can install the PowerDNS Authoritative Server packages from the official PowerDNS
repository overriding the `pdns_install_repo` variable as follows:

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

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

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

The completed lists of the available pre-configured repositories is available in the `vars/main.yml` file.

To install PowerDNS from a custom repositories follow the instructions below
To install the PowerDNS Authoritative Server from a custom repositories follow the instructions below

- hosts: all
vars:
Expand All @@ -53,32 +53,41 @@ To install PowerDNS from a custom repositories follow the instructions below
gpg_key: "http://my.repo.com/MYREPOGPGPUBKEY.asc" # repository public GPG key
gpg_key_id: "MYREPOGPGPUBKEYID" # to avoid to reimport the key each time the role is executed
yum_repo_baseurl: "http://my.repo.com/centos/$basearch/$releasever/pdns"
name: "powerdns" # the name of the repository
yum_debug_symbols_repo_baseurl: "http://my.repo.com/centos/$basearch/$releasever/pdns/debug"
name: "powerdns" # the name of the repository
roles:
- { role: PowerDNS.pdns }

Note that not all the keys of the `pdns_install_repo` dictionary are required. i.e., if the target hosts are running on Debian it's not necessary to provide the yum repository information.

pdns_install_epel: True

On RedHat-like system, this role configures EPEL by default.
On RedHat-like systems, this role configures EPEL by default.
EPEL is needed to satisfy some PowerDNS dependencies like `protobuf`.
To skip EPEL installation set `pdns_install_epel` to `False`.

pdns_package_name: "{{ default_pdns_package_name }}"

The name of the PowerDNS package, `pdns` on RedHat-like systems and `pdns-server` on Debian-like systems.
The name of the PowerDNS Authoritative Server package, `pdns` on RedHat-like systems and `pdns-server` on Debian-like systems.

pdns_package_version: ""

The version of the PowerDNS package to be installed. <br />
Install the PowerDNS Authoritative Server debug symbols.

pdns_install_debug_symbols_package: False

The name of the PowerDNS Authoritative Server debug package, `pdns-debuginfo` on RedHat-like systems and `pdns-server-dbg` on Debian-like systems.

pdns_debug_symbols_package_name: "{{ default_pdns_debug_symbols_package_name }}"

The version of the PowerDNS Authoritative Server package to be installed. <br />
**NOTE:** The usage of this variable makes only sense on RedHat-like systems, where each YUM repository can contains multiple versions of the same package.
For that reason, we highly recommend to not override the default value on Debian.

pdns_user: pdns
pdns_group: pdns

The user and group the PowerDNS process will run as.
The user and group the PowerDNS Authoritative Server process will run as.
**NOTE**: This role does not create the user or group as we assume that they've been created
by the package or other roles.

Expand All @@ -90,16 +99,16 @@ Name of the PowerDNS service.

Force the execution of the handlers at the end of the role. <br />
**NOTE:** This is required if using this role to configure multiple PowerDNS instances in the same play.
See PowerDNS virtual hosting https://doc.powerdns.com/md/authoritative/running/#starting-virtual-instances-with-system.
See PowerDNS Authoritative Server virtual hosting https://doc.powerdns.com/md/authoritative/running/#starting-virtual-instances-with-system.

pdns_config_dir: "{{ default_pdns_config_dir }}"
pdns_config_file: "pdns.conf"

PowerDNS configuration file and directory.
PowerDNS Authoritative Server configuration file and directory.

pdns_config: {}

A dict containing the PowerDNS configuration. <br />
A dict containing the PowerDNS Authoritative Server configuration. <br />
**NOTE:** The PowerDNS backends configuration and the `config-dir`, `setuid` and `setgid` directives must be configured through the `pdns_user`, `pdns_group` and `pdns_backends` role variables (see `templates/pdns.conf.j2`).
For example:

Expand All @@ -110,7 +119,7 @@ For example:
local-ipv6: '2001:DB8:1::53'
local-port: '5300'

configures PowerDNS to listen incoming DNS requests on port 5300.
configures PowerDNS Authoritative Server to listen incoming DNS requests on port 5300.

pdns_backends:
bind:
Expand Down Expand Up @@ -140,7 +149,7 @@ By default this role starts just the bind-backend with an empty config file.

pdns_mysql_databases_credentials: {}

Administrative credentials for the MySQL backend used to create the PowerDNS databases and users.
Administrative credentials for the MySQL backend used to create the PowerDNS Authoritative Server databases and users.
For example:

pdns_mysql_databases_credentials:
Expand All @@ -156,12 +165,12 @@ For example:
'priv_host':
- "localhost"

Notice that this must only containes the credentials
Notice that this must only containes the credentials
for the `gmysql` backends provided in `pdns_backends`.

pdns_sqlite_databases_locations: []

Locations of the SQLite3 databases that have to be created if using the
Locations of the SQLite3 databases that have to be created if using the
`gsqlite3` backend.

Example Playbooks
Expand All @@ -181,7 +190,7 @@ Run as a master using the bind backend (when you already have a `named.conf` fil
config: '/etc/named/named.conf'


Install the latest 'master' build of PowerDNS and enable the MySQL backend:
Install the latest 'master' build of PowerDNS Authoritative Server and enable the MySQL backend:

- hosts: ns2.example.net
roles:
Expand All @@ -200,8 +209,8 @@ Install the latest 'master' build of PowerDNS and enable the MySQL backend:
pdns_install_repo: "{{ pdns_auth_powerdns_repo_master }}"


Install the latest '41' build of PowerDNS enabling the MySQL backend.
Provides also the MySQL administrative credentials to automatically create and initialize the PowerDNS user and database:
Install the latest '41' build of PowerDNS Authoritative Server enabling the MySQL backend.
Provides also the MySQL administrative credentials to automatically create and initialize the PowerDNS Authoritative Server user and database:

- hosts: ns2.example.net
roles:
Expand Down Expand Up @@ -229,7 +238,7 @@ Provides also the MySQL administrative credentials to automatically create and i
**NOTE:** In this case the role will use the credentials provided in `pdns_mysql_databases_credentials` to automatically create and initialize the user (`user`, `password`) and database (`dbname`) connecting to the MySQL server (`host`, `port`).


Configure PowerDNS in 'master' mode reading zones from two different PostgreSQL databases:
Configure PowerDNS Authoritative Server in 'master' mode reading zones from two different PostgreSQL databases:

- hosts: ns2.example.net
roles:
Expand All @@ -252,7 +261,7 @@ Configure PowerDNS in 'master' mode reading zones from two different PostgreSQL
dbname: dns


Configure PowerDNS to run with the gsqlite3 backend.
Configure PowerDNS Authoritative Server to run with the gsqlite3 backend.
The SQLite database will be created and initialized by the role
in the location specified by the `database_name` variable.

Expand Down
37 changes: 22 additions & 15 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
---

# By default, no PowerDNS repository will be configured by the role
# By default, no PowerDNS Authoritative Server repository will be configured by the role
pdns_install_repo: ""

# To install PowerDNS from the 'master' official repository
# To install tje PowerDNS Authoritative Server from the 'master' official repository
# use the following playbook snippet
# - hosts: all
# roles:
# - { role: PowerDNS.pdns,
# pdns_install_repo: "{{ pdns_auth_powerdns_repo_master }}"
#
# To install PowerDNS from the '4.0.x' official repository
# To install the PowerDNS Authoritative Server from the '4.0.x' official repository
# use the following playbook snippet
# - hosts: all
# roles:
# - { role: PowerDNS.pdns,
# pdns_install_repo: "{{ pdns_auth_powerdns_repo_40 }}"
#
# To install PowerDNS from the '4.1.x' official repository
# To install the PowerDNS Authoritative Server from the '4.1.x' official repository
# use the following playbook snippet
# - hosts: all
# roles:
# - { role: PowerDNS.pdns,
# pdns_install_repo: "{{ pdns_auth_powerdns_repo_41 }}"
#
# To make this role configure a custom repository and install
# PowerDNS from it override the `pdns_install_repo` variable
# To make this role configure a custom repository and install the
# PowerDNS Authoritative Server from it override the `pdns_install_repo` variable
# as follows
# - hosts: all
# vars:
Expand All @@ -40,33 +40,39 @@ pdns_install_repo: ""
# - { role: PowerDNS.pdns }

# Install the EPEL repository.
# EPEL is needed to satisfy some PowerDNS dependencies like protobuf
# EPEL is needed to satisfy some PowerDNS Authoritative Server dependencies like protobuf
pdns_install_epel: True

# The name of the PowerDNS package
# The name of the PowerDNS Authoritative Server package
pdns_package_name: "{{ default_pdns_package_name }}"

# Install a specific version of the PowerDNS package
# Install a specific version of the PowerDNS Authoritative Server package
# NB: The usage of this variable makes only sense on RedHat-like systems,
# where each YUM repository can contains multiple versions of the same package.
pdns_package_version: ""

# The user and group the PowerDNS process will run as.
# Install the PowerDNS Authoritative Server debug symbols package
pdns_install_debug_symbols_package: False

# The name of the PowerDNS Authoritative Server debug symbols package
pdns_debug_symbols_package_name: "{{ default_pdns_debug_symbols_package_name }}"

# The user and group the PowerDNS Authoritative Server process will run as.
# NOTE: at the moment, we don't create a user as we assume the package creates
# a "pdns" user and group. If you change these variables, make sure to create
# the user and groups before applying this role
pdns_user: pdns
pdns_group: pdns

# Name of the PowerDNS Service
# Name of the PowerDNS Authoritative Server Service
pdns_service_name: "pdns"

# Force the execution of the handlers at the end of the role.
# This is required if using this role to configure multiple pdns auth instance in the same single play.
# See PowerDNS virtual hosting https://doc.powerdns.com/md/authoritative/running/#starting-virtual-instances-with-system.
# See PowerDNS Authoritative Server virtual hosting https://doc.powerdns.com/md/authoritative/running/#starting-virtual-instances-with-system.
pdns_flush_handlers: False

# PowerDNS configuration file and directory
# PowerDNS Authoritative Server configuration file and directory
pdns_config_dir: "{{ default_pdns_config_dir }}"
pdns_config_file: "pdns.conf"

Expand Down Expand Up @@ -99,6 +105,7 @@ pdns_config: {}
# 'gmysql:two':
# 'user': pdns_user
# 'host': 192.0.2.15
# 'port': 3307
# 'password': my_password
# 'dbname': dns
# 'bind':
Expand All @@ -111,7 +118,7 @@ pdns_backends:
bind:
config: '/dev/null'

# Administrative credentials to create the PowerDNS MySQL backend database and user.
# Administrative credentials to create the PowerDNS Authoritative Server MySQL backend database and user.
# For example:
# pdns_mysql_databases_credentials:
# 'gmysql:one':
Expand All @@ -127,7 +134,7 @@ pdns_backends:
# - "localhost"
pdns_mysql_databases_credentials: {}

# This will create the PowerDNS backend SQLite database
# This will create the PowerDNS Authoritative Server backend SQLite database
# in the given locations.
# NOTE: Requries the SQLite CLI tools to be available in the machine and the gsqlite3
# backend to be installed on the machine.
Expand Down
31 changes: 0 additions & 31 deletions molecule/common/tests/test_repo.py

This file was deleted.

Loading