{"id":19070734,"url":"https://github.com/powerdns/pdns-ansible","last_synced_at":"2025-05-16T11:05:33.246Z","repository":{"id":2157532,"uuid":"43064440","full_name":"PowerDNS/pdns-ansible","owner":"PowerDNS","description":"PowerDNS Authoritative Ansible role","archived":false,"fork":false,"pushed_at":"2025-02-20T09:49:50.000Z","size":268,"stargazers_count":151,"open_issues_count":38,"forks_count":135,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-09T11:09:07.110Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerDNS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-24T12:07:40.000Z","updated_at":"2025-03-22T00:15:52.000Z","dependencies_parsed_at":"2024-01-16T13:31:17.727Z","dependency_job_id":"48cdb420-5738-49b7-afac-bf68d0830e82","html_url":"https://github.com/PowerDNS/pdns-ansible","commit_stats":{"total_commits":173,"total_committers":33,"mean_commits":5.242424242424242,"dds":0.6242774566473989,"last_synced_commit":"889c18cca059211ac8673c837588d0da083b3947"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerDNS%2Fpdns-ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerDNS%2Fpdns-ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerDNS%2Fpdns-ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerDNS%2Fpdns-ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerDNS","download_url":"https://codeload.github.com/PowerDNS/pdns-ansible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-11-09T01:20:11.162Z","updated_at":"2025-05-16T11:05:28.237Z","avatar_url":"https://github.com/PowerDNS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Role: PowerDNS Authoritative Server\n\n[![Build Status](https://github.com/PowerDNS/pdns-ansible/actions/workflows/main.yml/badge.svg)](https://github.com/PowerDNS/pdns-ansible)\n[![License](https://img.shields.io/badge/license-MIT%20License-brightgreen.svg)](https://opensource.org/licenses/MIT)\n[![Ansible Role](https://img.shields.io/badge/ansible%20role-PowerDNS.pdns-blue.svg)](https://galaxy.ansible.com/PowerDNS/pdns)\n[![GitHub tag](https://img.shields.io/github/tag/PowerDNS/pdns-ansible.svg)](https://github.com/PowerDNS/pdns-ansible/tags)\n\nAn Ansible role created by the folks behind PowerDNS to setup the [PowerDNS Authoritative Server](https://docs.powerdns.com/authoritative/).\n\n## Requirements\n\nAn Ansible 2.12 or higher installation.\n\n## Dependencies\n\nNone.\n\n## Role Variables\n\nAvailable variables are listed below, along with their default values (see `defaults/main.yml`):\n\n```yaml\npdns_install_repo: \"\"\n```\n\nBy default, the PowerDNS Authoritative Server is installed from the software repositories configured on the target hosts.\n\n```yaml\n# Install the PowerDNS Authoritative Server from the 'master' official repository\n- hosts: all\n  roles:\n    - { role: PowerDNS.pdns,\n        pdns_install_repo: \"{{ pdns_auth_powerdns_repo_master }}\"\n\n# Install the PowerDNS Authoritative Server from the '4.7.x' official repository\n- hosts: all\n  roles:\n    - { role: PowerDNS.pdns,\n        pdns_install_repo: \"{{ pdns_auth_powerdns_repo_47 }}\"\n        \n# Install the PowerDNS Authoritative Server from the '4.8.x' official repository\n- hosts: all\n  roles:\n    - { role: PowerDNS.pdns,\n        pdns_install_repo: \"{{ pdns_auth_powerdns_repo_48 }}\"\n        \n# Install the PowerDNS Authoritative Server from the '4.9.x' official repository\n- hosts: all\n  roles:\n    - { role: PowerDNS.pdns,\n        pdns_install_repo: \"{{ pdns_auth_powerdns_repo_49 }}\"\n```\n\nThe examples above, show how to install the PowerDNS Authoritative Server from the official PowerDNS repositories\n(see the complete list of pre-defined repos in `vars/main.yml`).\n\n```yaml\n- hosts: all\n  vars:\n    pdns_install_repo:\n      name: \"powerdns\" # the name of the repository\n      apt_repo_origin: \"example.com\"  # used to pin the PowerDNS packages to the provided repository\n      apt_repo: \"deb http://example.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}/pdns main\"\n      gpg_key: \"http://example.com/MYREPOGPGPUBKEY.asc\" # repository public GPG key\n      gpg_key_id: \"MYREPOGPGPUBKEYID\" # to avoid to reimport the key each time the role is executed\n      yum_repo_baseurl: \"http://example.com/centos/$basearch/$releasever/pdns\"\n      yum_debug_symbols_repo_baseurl: \"http://example.com/centos/$basearch/$releasever/pdns/debug\"\n  roles:\n    - { role: PowerDNS.pdns }\n```\n\nIt is also possible to install the PowerDNS Authoritative Server from custom repositories as demonstrated in the example above.\n**Note:** These repositories are ignored on Arch Linux\n\n```yaml\n pdns_install_epel: True\n```\n\nBy default, install EPEL to satisfy some PowerDNS Authoritative Server dependencies like `protobuf`.\nTo skip the installtion of EPEL set `pdns_install_epel` to `False`.\n\n```yaml\npdns_package_name: \"{{ default_pdns_package_name }}\"\n```\n\nThe name of the PowerDNS Authoritative Server package, `pdns` on RedHat-like systems and `pdns-server` on Debian-like systems.\n\n```yaml\npdns_package_version: \"\"\n```\n\nOptionally, allow to set a specific version of the PowerDNS Authoritative Server package to be installed.\n\n```yaml\npdns_install_debug_symbols_package: False\n```\n\nInstall the PowerDNS Authoritative Server debug symbols.\n\n```yaml\npdns_debug_symbols_package_name: \"{{ default_pdns_debug_symbols_package_name }}\"\n```\n\nThe name of the PowerDNS Authoritative Server debug package to be installed when `pdns_install_debug_symbols_package` is `True`,\n`pdns-debuginfo` on RedHat-like systems and `pdns-server-dbg` on Debian-like systems.\n\n```yaml\npdns_user: pdns\npdns_group: pdns\n```\n\nThe user and group the PowerDNS Authoritative Server process will run as. \u003cbr /\u003e\n**NOTE**: This role does not create the user or group as we assume that they've been created\nby the package or other roles.\n\n```yaml\npdns_service_name: \"pdns\"\n```\n\nName of the PowerDNS service.\n\n```yaml\npdns_service_state: \"started\"\npdns_service_enabled: \"yes\"\n```\n\nAllow to specify the desired state of the PowerDNS Authoritative Server service.\n\n```yaml\npdns_disable_handlers: False\n```\n\nDisable automated service restart on configuration changes.\n\n```yaml\npdns_config_dir: \"{{ default_pdns_config_dir }}\"\npdns_config_file: \"pdns.conf\"\n```\n\nPowerDNS Authoritative Server configuration file and directory.\n\n```yaml\npdns_config: {}\n```\n\nDictionary containing the PowerDNS Authoritative Server configuration. \u003cbr /\u003e\n**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`).\nFor example:\n\n```yaml\npdns_config:\n  master: yes\n  slave: no\n  local-address: '192.0.2.53'\n  local-ipv6: '2001:DB8:1::53'\n  local-port: '5300'\n```\n\nconfigures PowerDNS Authoritative Server to listen incoming DNS requests on port 5300.\n\n```yaml\npdns_service_overrides:\n  User: {{ pdns_user }}\n  Group: {{ pdns_group }}\n```\n\nDict with overrides for the service (systemd only).\nThis can be used to change any systemd settings in the `[Service]` category.\n\n```yaml\npdns_backends:\n  bind:\n    config: '/dev/null'\n```\n\nDictionary declaring all the backends you'd like to enable. You can use\nmultiple backends of the same kind by using the `{backend}:{instance_name}` syntax.\nFor example:\n\n```yaml\npdns_backends:\n  'gmysql:one':\n    'user': root\n    'host': 127.0.0.1\n    'password': root\n    'dbname': pdns\n  'gmysql:two':\n    'user': pdns_user\n    'host': 192.0.2.15\n    'password': my_password\n    'dbname': dns\n  'bind':\n    'config': '/etc/named/named.conf'\n    'hybrid':  yes\n    'dnssec-db': '{{ pdns_config_dir }}/dnssec.db'\n```\n\nBy default this role starts just the bind-backend with an empty config file.\n\n```yaml\npdns_mysql_databases_credentials: {}\n```\n\nAdministrative credentials for the MySQL backend used to create the PowerDNS Authoritative Server databases and users.\nFor example:\n\n```yaml\npdns_mysql_databases_credentials:\n  'gmysql:one':\n    'priv_user': root\n    'priv_password': my_first_password\n    'priv_host':\n      - \"localhost\"\n      - \"%\"\n  'gmysql:two':\n    'priv_user': someprivuser\n    'priv_password': my_second_password\n    'priv_host':\n      - \"localhost\"\n```\n\nNotice that this must only contain the credentials\nfor the `gmysql` backends provided in `pdns_backends`.\n\n```yaml\npdns_sqlite_databases_locations: []\n```\n\nLocations of the SQLite3 databases that have to be created if using the\n`gsqlite3` backend.\n\n```yaml\npdns_lmdb_databases_locations: []\n```\n\nLocations of the LMDB databases that have to be created if using the\n`lmdb` backend.\n\nLocations of the mysql and sqlite3 base schema.\nWhen set, this value is used and they are not automatically detected.\n```yaml\npdns_mysql_schema_file: ''\n\npdns_sqlite3_schema_file: ''\n```\n\n## Example Playbooks\n\nRun as a master using the bind backend (when you already have a `named.conf` file):\n\n```yaml\n- hosts: ns1.example.net\n  roles:\n    - { role: PowerDNS.pdns }\n  vars:\n    pdns_config:\n      master: true\n      local-address: '192.0.2.53'\n    pdns_backends:\n      bind:\n        config: '/etc/named/named.conf'\n```\n\nInstall the latest '41' build of PowerDNS Authoritative Server enabling the MySQL backend.\nProvides also the MySQL administrative credentials to automatically create and initialize the PowerDNS Authoritative Server user and database:\n\n```yaml\n- hosts: ns2.example.net\n  roles:\n    - { role: PowerDNS.pdns }\n  vars:\n    pdns_config:\n      master: true\n      slave: false\n      local-address: '192.0.2.77'\n    pdns_backends:\n      gmysql:\n        host: 192.0.2.120\n        port: 3306\n        user: powerdns\n        password: P0w3rDn5\n        dbname: pdns\n    pdns_mysql_databases_credentials:\n      gmysql:\n        priv_user: root\n        priv_password: myrootpass\n        priv_host:\n          - \"%\"\n    pdns_install_repo: \"{{ pdns_auth_powerdns_repo_41 }}\"\n```\n\n**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`).\n\nConfigure PowerDNS Authoritative Server in 'master' mode reading zones from two different PostgreSQL databases:\n\n```yaml\n- hosts: ns2.example.net\n  roles:\n    - { role: PowerDNS.pdns }\n  vars:\n    pdns_config:\n      master: true\n      local-port: 5300\n      local-address: '192.0.2.111'\n    pdns_backends:\n      'gpgsql:serverone':\n        host: 192.0.2.124\n        user: powerdns\n        password: P0w3rDn5\n        dbname: pdns2\n      'gpgsql:otherserver':\n        host: 192.0.2.125\n        user: root\n        password: root\n        dbname: dns\n```\n\nConfigure PowerDNS Authoritative Server to run with the `gsqlite3` backend.\nThe SQLite database will be created and initialized by the role\nin the location specified by the `database_name` variable.\n\n```yaml\n- hosts: ns4.example.net\n  roles:\n    - { role: PowerDNS.pdns }\n  vars:\n    database_name: '/var/lib/powerdns/db.sqlite'\n    pdns_config:\n      master: true\n      slave: false\n      local-address: '192.0.2.73'\n    pdns_backends:\n      gsqlite3:\n        database: \"{{ database_name }}\"\n        dnssec: yes\n    pdns_sqlite_databases_locations:\n      - \"{{ database_name }}\"\n```\n\n## Changelog\n\nA detailed changelog of all the changes applied to the role is available [here](./CHANGELOG.md).\n\n## Testing\n\nTests are performed by [Molecule](http://molecule.readthedocs.org/en/latest/).\n\n    $ pip install tox\n\nTo test all the scenarios run\n\n    $ tox\n\nTo run a custom molecule command\n\n    $ tox -e ansible214 -- molecule test -s pdns-49\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerdns%2Fpdns-ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowerdns%2Fpdns-ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerdns%2Fpdns-ansible/lists"}