From 9c17782abed4256d4beaa52d7f3151cee5544c58 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 7 May 2018 19:07:21 +0200 Subject: [PATCH] Initial parts of a powerdns role for the authoritative server --- powerdns-authoritative/defaults/main.yml | 19 +++++++++++++++++++ powerdns-authoritative/tasks/main.yml | 16 ++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 powerdns-authoritative/defaults/main.yml create mode 100644 powerdns-authoritative/tasks/main.yml diff --git a/powerdns-authoritative/defaults/main.yml b/powerdns-authoritative/defaults/main.yml new file mode 100644 index 00000000..20ed933e --- /dev/null +++ b/powerdns-authoritative/defaults/main.yml @@ -0,0 +1,19 @@ +--- +powerdns_auth_major: 4 +powerdns_auth_minor: 1 +powerdns_auth_version: '{{ powerdns_auth_major }}.{{ powerdns_auth_minor }}' +powerdns_auth_repo_data: 'deb [arch=amd64] http://repo.powerdns.com/ubuntu {{ ansible_distribution_release }}-auth-{{ powerdns_auth_major }}{{ powerdns_auth_minor }} main' +powerdns_auth_repo_key: 'https://repo.powerdns.com/FD380FBB-pub.asc' + +powerdns_auth_db_backend: pgsql +powerdns_auth_enable_api: True +powerdns_auth_enable_web_interface: True + +powerdns_auth_pkgs: + - pdns-server + - pdns-tools + - pdns-backend-lua + - pdns-backend-remote + - pdns-backend-pipe + - 'pdns-backend-{{ powerdns_auth_db_backend }}' + diff --git a/powerdns-authoritative/tasks/main.yml b/powerdns-authoritative/tasks/main.yml new file mode 100644 index 00000000..67e4500e --- /dev/null +++ b/powerdns-authoritative/tasks/main.yml @@ -0,0 +1,16 @@ +--- +- block: + - name: Get the Powerdns repo key + apt_key: url={{ powerdns_auth_repo_key }} state=present + + - name: Define the Powerdns package repository + apt_repository: repo='{{ powerdns_auth_repo_data }}' state=present update_cache=yes + + - name: Install the powerdns packages + apt: pkg={{ item }} state=present + with_items: '{{ powerdns_auth_pkgs }}' + + - name: Ensure that powerdns is running and enabled + service: name=pdns state=started enabled=yes + + tags: [ 'dns', 'powerdns' ]