{"id":19070728,"url":"https://github.com/powerdns/pdns_recursor-ansible","last_synced_at":"2026-01-17T10:58:27.541Z","repository":{"id":48996380,"uuid":"43518013","full_name":"PowerDNS/pdns_recursor-ansible","owner":"PowerDNS","description":"PowerDNS Recursor Ansible role","archived":false,"fork":false,"pushed_at":"2025-02-19T18:01:35.000Z","size":259,"stargazers_count":46,"open_issues_count":17,"forks_count":52,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-30T00:05:40.862Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","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-10-01T20:03:23.000Z","updated_at":"2025-03-12T17:07:30.000Z","dependencies_parsed_at":"2024-01-16T18:35:50.863Z","dependency_job_id":"5150eb7d-c6fd-473f-bee2-c375b7cf8e56","html_url":"https://github.com/PowerDNS/pdns_recursor-ansible","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerDNS%2Fpdns_recursor-ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerDNS%2Fpdns_recursor-ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerDNS%2Fpdns_recursor-ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerDNS%2Fpdns_recursor-ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerDNS","download_url":"https://codeload.github.com/PowerDNS/pdns_recursor-ansible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419859,"owners_count":20936012,"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:10.753Z","updated_at":"2026-01-17T10:58:27.535Z","avatar_url":"https://github.com/PowerDNS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Role: PowerDNS Recursor\n\n[![Build Status](https://github.com/PowerDNS/pdns_recursor-ansible/actions/workflows/main.yml/badge.svg)](https://github.com/PowerDNS/pdns_recursor-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_recursor-blue.svg)](https://galaxy.ansible.com/PowerDNS/pdns_recursor)\n[![GitHub tag](https://img.shields.io/github/tag/PowerDNS/pdns_recursor-ansible.svg)](https://github.com/PowerDNS/pdns_recursor-ansible/tags)\n\nAn Ansible role created by the folks behind PowerDNS to setup the [PowerDNS Recursor](https://docs.powerdns.com/recursor/).\n\n## Requirements\n\nAn Ansible 2.15 or higher installation.\n\n## Dependencies\n\nNone.\n\n## Role Variables\n\nAvailable variables are listed below, along with default values (see `defaults/main.yml`):\n\n```yaml\npdns_rec_install_repo: \"\"\n```\n\nBy default, the PowerDNS Recursor is installed from the software repositories configured on the target hosts.\n\n```yaml\n# Install the PowerDNS Recursor from the 'master' official repository\n- hosts: pdns_recursors\n  roles:\n  - { role: powerdns.pdns_recursor,\n      pdns_rec_install_repo: \"{{ pdns_rec_powerdns_repo_master }}\" }\n\n# Install the PowerDNS Recursor from the '5.1.x' official repository\n- hosts: pdns_recursors\n  roles:\n  - { role: powerdns.pdns_recursor,\n      pdns_rec_install_repo: \"{{ pdns_rec_powerdns_repo_51 }}\" }\n\n# Install the PowerDNS Recursor from the '5.2.x' official repository\n- hosts: pdns_recursors\n  roles:\n  - { role: powerdns.pdns_recursor,\n      pdns_rec_install_repo: \"{{ pdns_rec_powerdns_repo_52 }}\" }\n\n# Install the PowerDNS Recursor from the '5.3.x' official repository\n- hosts: pdns_recursors\n  roles:\n  - { role: powerdns.pdns_recursor,\n      pdns_rec_install_repo: \"{{ pdns_rec_powerdns_repo_53 }}\" }\n```\n\nThe examples above, show how to install the PowerDNS Recursor from the official PowerDNS repositories\n(see the complete list of pre-defined repos in `vars/main.yml`).\n\nThe roles also supports custom repositories\n\n```yaml\n- hosts: all\n  vars:\n    pdns_rec_install_repo:\n      name: \"powerdns-rec\"  # the name of the repository\n      apt_version: rec-master # deb822 suites parameter\n      apt_repo_origin: \"repo.example.com\"   # used to pin the PowerDNS packages to the provided repository\n      apt_repo: \"deb http://repo.example.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}/pdns-recursor main\"\n      gpg_key: \"http://repo.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://repo.example.com/el/$basearch/$releasever/pdns-recursor\"\n      yum_repo_debug_symbols_baseurl: \"http://repo.example.com/el/$basearch/$releasever/pdns-recursor/debug\"\n  roles:\n  - { role: powerdns.pdns_recursor }\n```\n\nIt is also possible to install the PowerDNS Recursor from custom repositories as demonstrated in the example above.\n\n```yaml\npdns_rec_install_epel: True\n```\n\nBy default, install EPEL to satisfy some PowerDNS Recursor dependencies like `protobuf`.\nTo skip the installation of EPEL set `pdns_rec_install_epel` to `False`.\n\n```yaml\npdns_rec_package_name: \"{{ default_pdns_rec_package_name }}\"\n```\n\nThe name of the PowerDNS Recursor package, `pdns-recursor` on RedHat-like Debian-like systems.\n\n```yaml\npdns_rec_package_version: \"\"\n```\n\nOptionally, allow to set a specific version of the PowerDNS Recursor package to be installed.\n\n```yaml\npdns_rec_install_debug_symbols_package: False\n```\n\nInstall the PowerDNS Recursor debug symbols.\n\n```yaml\npdns_rec_debug_symbols_package_name: \"{{ default_pdns_rec_debug_symbols_package_name }}\"\n```\n\nThe name of the PowerDNS Recursor debug package to be installed when `pdns_install_debug_symbols_package` is `True`,\n`pdns-recursor-debuginfo` on RedHat-like systems and `pdns-recursor-dbg` on Debian-like systems.\n\n```yaml\npdns_rec_user: \"{{ default_pdns_rec_user }}\"\npdns_rec_group: \"{{ default_pdns_rec_group }}\"\n```\n\nThe user and group the PowerDNS Recursor will run as, `pdns-recursor` on RedHat-like systems and `pdns` on Debian-like systems \u003cbr /\u003e\n**NOTE**: This role does not create any user or group as we assume that they're created\nby the package or other roles.\n\n```yaml\npdns_rec_file_owner: \"root\"\npdns_rec_file_group: \"{{ default_pdns_file_group }}\"\n```\n\nUser and group owning the configuration files and directories.\n\n```yaml\npdns_rec_service_name: \"pdns-recursor\"\n```\n\nThe name of the PowerDNS Recursor service.\n\n```yaml\npdns_rec_service_state: \"started\"\npdns_rec_service_enabled: true\npdns_rec_service_masked: false\n```\n\nAllow to specify the desired state of the PowerDNS Recursor service.\nE.g. This allows to install and configure the PowerDNS Recursor without automatically starting the service.\n\n```yaml\npdns_rec_disable_handlers: False\n```\n\nDisable automated service restart on configuration changes.\n\n```yaml\npdns_rec_config_dir: \"{{ default_pdns_rec_config_dir }}\"\npdns_rec_config_file: \"recursor.conf\"\n```\n\nThe PowerDNS Recursor configuration files and directories, where `default_pdns_rec_config_dir` is `/etc/powerdns` on Debian and `/etc/pdns-recursor` on RedHat.\n\n```yaml\npdns_rec_config: {}\n```\n\nDictionary containing in YAML format configuration of PowerDNS Recursor. See https://docs.powerdns.com/recursor/yamlsettings.html.\n\n```yaml\npdns_rec_config_additional_dirs: []\n# pdns_rec_config_additional_dirs:\n#   - path: \"{{ pdns_rec_config.webservice.api_dir }}\"\n#     mode: '0775'\n#   - \"{{ pdns_rec_config.recursor.include_dir }}\"\n#   - \"/var/lib/pdns-recursor/rpz\"\n```\n\nAdditional directories for configuration or supplementary files.\n\n```yaml\npdns_rec_config_additional_files: []\n# pdns_rec_config_additional_files:\n#   - dest: \"/var/lib/pdns-recursor/rpz/test.rpz\"\n#     content: |\n#       test.rpz.               60   IN SOA    ns.test.rpz. hostmaster.test.rpz. 1 10800 60 3600 3600\n#       test-rpz.com.test.rpz.  60   IN A  127.0.0.2\n```\n\nAdditional configuration or supplementary files for PowerDNS Recursor, e.g RPZ files.\n\n## Example Playbooks\n\nBind to `203.0.113.53` on port `5300` and allow only traffic from the `198.51.100.0/24` subnet:\n\n```yaml\n- hosts: pdns_recursors\n  vars:\n    pdns_rec_config:\n      incoming:\n        listen:\n          - 203.0.113.53:5300\n        allow_from: [ 198.51.100.0/24 ]\n  roles:\n    - { role: powerdns.pdns_recursor }\n```\n\nAllow traffic from multiple networks and set some custom ulimits overriding the default systemd service:\n\n```yaml\n- hosts: pdns_recursors\n  vars:\n    pdns_rec_config:\n      incoming:\n        listen:\n          - 203.0.113.53:5300\n        allow_from: [ 198.51.100.0/24, 198.51.100.0/24 ]\n    pdns_rec_service_overrides:\n      LimitNOFILE: 10000\n  roles:\n    - { role: powerdns.pdns_recursor }\n```\n\nForward queries for corp.example.net to a nameserver on localhost and queries for foo.example to other nameservers:\n\n```yaml\n- hosts: pdns_recursors\n  vars:\n    pdns_rec_config:\n      recursor:\n        forward_zones:\n          - zone: corp.example.net\n            forwarders:\n              - 127.0.0.1:5300\n          - zone: foo.example\n            forwarders:\n              - \"192.0.2.3\"\n              - \"[2001:db8::2:3]\"\n  roles:\n    - { role: powerdns.pdns_recursor }\n```\n\n## Release notes\n\nSee the [CHANGELOG.md](https://github.com/PowerDNS/pdns_recursor-ansible/blob/master/CHANGELOG.md).\n\n## Contributing\n\n- Every pull request must include a [changelog fragment](https://docs.ansible.com/ansible/devel/community/collection_development_process.html#creating-a-changelog-fragment).\n- Each changelog entry must include a link to the pull request.\n- If the pull request addresses an issue, also include a link to the related issue.\n- Ensure each changelog entry starts with a lowercase letter (immediately after the dash) and ends with a period.\n- Copy [`fragment-example.yaml`](changelogs/fragment-example.yaml) into [`changelogs/fragments`](changelogs/fragments) and name it `num-pr-title.yaml`, where:\n  - `num` is the pull request number\n  - `pr-title` is the pull request title (use a short, filesystem-friendly version)\n\n## Testing\n\nTests are performed by [Molecule](http://molecule.readthedocs.org/en/latest/).\n\n```bash\n$ pip install tox\n```\n\nTo test all the scenarios run\n\n```bash\n$ tox\n```\n\nTo run a custom molecule command\n\n```bash\n$ tox -e ansible216 -- molecule test -s pdns-rec-53\n```\n\n## License\n\nSee [LICENSE](https://github.com/PowerDNS/pdns_recursor-ansible/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerdns%2Fpdns_recursor-ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowerdns%2Fpdns_recursor-ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerdns%2Fpdns_recursor-ansible/lists"}