https://github.com/vitalk/ansible-dns-zones
Ansible role to generate DNS zones from jinja templates
https://github.com/vitalk/ansible-dns-zones
Last synced: 4 months ago
JSON representation
Ansible role to generate DNS zones from jinja templates
- Host: GitHub
- URL: https://github.com/vitalk/ansible-dns-zones
- Owner: vitalk
- Created: 2014-08-04T12:06:31.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-10-23T14:44:52.000Z (almost 12 years ago)
- Last Synced: 2025-06-24T08:46:37.648Z (about 1 year ago)
- Homepage: https://galaxy.ansible.com/vitalk/dns-zones
- Size: 215 KB
- Stars: 4
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
DNS Zones
=========
Ansible role to generate dns zones from jinja templates.
Role Variables
--------------
Option | Description
--- | ---
`dns_zones` | An optional list of dns zones to generate. You **must select** zones you want to generate explicitly.
`dns_zones_input_directory` | Path to zone files templates. Defaults to `templates` in the role directory.
`dns_zones_output_directory` | The destination directory for generated zones. Defaults to `files` in the role directory.
Usage Example
-------------
Explicitly define template for each zone you wanna to create...
```jinja
# file: templates/db.example.com.j2
{% extends 'db.zone.j2' %}
{% set serial = 2014080301 %}
{% block a %}
IN A 1.2.3.4
ns1 IN A 1.2.3.4
mail IN A 1.2.3.4
www IN CNAME @
{% endblock %}
```
```yaml
# file: test.yml
---
- hosts: all
gather_facts: no
vars:
dns_zones:
- name: example.com
roles:
- .
```
And finally play it...
```bash
ansible-playbook -i hosts.example test.yml
```
License
-------
Licensed under the [MIT license](http://mit-license.org/vitalk).
Self-Promotion
--------------
Created by Vital Kudzelka.
Don't hesitate create [a GitHub Issue](https://github.com/vitalk/ansible-dns-zones/issues) if you have any suggestions or found a bug.