Skip to content

Commit 54dbd79

Browse files
authored
Add support for deploying Zone files. (#32)
[minor] Signed-off-by: Ben Kochie <[email protected]>
1 parent 0a8c963 commit 54dbd79

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

.yamllint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
extends: default
23
ignore: |
34
.travis/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ Use it in a playbook as follows:
3434
- cloudalchemy.coredns
3535
```
3636
37-
### Demo site
37+
## Zone files
3838
39-
We provide demo site for full monitoring solution based on prometheus and grafana. Repository with code and links to running instances is [available on github](https://github.com/cloudalchemy/demo-site) and site is hosted on [DigitalOcean](https://digitalocean.com).
39+
The role will search in `coredns/zones` in the Ansible templates paths for files to deploy. These can be used with the [`file` plugin](https://coredns.io/plugins/file/).
4040

4141
## Local Testing
4242

tasks/configure.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@
77
group: root
88
mode: 0644
99
notify: restart coredns
10+
11+
- name: Copy zone files
12+
template:
13+
src: "{{ item }}"
14+
dest: /etc/coredns/zones
15+
owner: root
16+
group: root
17+
mode: 0644
18+
with_fileglob:
19+
- coredns/zones/*

tasks/install.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
createhome: false
1616
home: /
1717

18-
- name: create coredns configuration directory
18+
- name: create coredns configuration directories
1919
file:
20-
path: "/etc/coredns"
20+
path: "{{ item }}"
2121
state: directory
2222
owner: root
2323
group: root
2424
mode: 0755
25+
with_items:
26+
- /etc/coredns
27+
- /etc/coredns/zones
2528

2629
- name: Download coredns binary to local folder
2730
become: false

0 commit comments

Comments
 (0)