Skip to content

Commit 5a4d54b

Browse files
committed
Add option to deploy dnssec keys
Add a template to deploy dnssec key files * Owned by CoreDNS user. * Read-only for just the CoreDNS user. Signed-off-by: SuperQ <[email protected]>
1 parent c507e6c commit 5a4d54b

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
1919

2020
| Name | Default Value | Description |
2121
| ---------------------------- | -------------- | -----------------------------------|
22-
| `coredns_version` | 1.8.3 | CoreDNS package version |
23-
| `coredns_binary_local_dir` | "" | Allows to use local packages instead of ones distributed on github. As parameter it takes a directory where `coredns` binary is stored on host on which ansible is ran. This overrides `coredns_version` parameter |
22+
| `coredns_version` | 1.8.3 | CoreDNS package version |
23+
| `coredns_binary_local_dir` | "" | Allows to use local packages instead of ones distributed on github. As parameter it takes a directory where `coredns` binary is stored on host on which ansible is ran. This overrides `coredns_version` parameter |
2424
| `coredns_dns_port` | 53 | Port on which CoreDNS will listen for DNS requests |
2525
| `coredns_config_file` | | This should contain path to file with coredns configuration [Corefile](https://coredns.io/manual/toc/#configuration) |
26-
| `coredns_zone_files_paths` | ["coredns/zones/*"] | List containing paths to zone files
26+
| `coredns_key_files_paths` | `["coredns/keys/*"]` | List containing paths to dnssec key files
27+
| `coredns_zone_files_paths` | `["coredns/zones/*"]` | List containing paths to zone files
2728

2829
## Example
2930

defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ coredns_binary_local_dir: ""
1010

1111
coredns_zone_files_paths:
1212
- "coredns/zones/*"
13+
14+
coredns_key_files_paths:
15+
- "coredns/keys/*"

tasks/configure.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
mode: 0644
99
notify: restart coredns
1010

11+
- name: Copy key files
12+
template:
13+
src: "{{ item }}"
14+
dest: /etc/coredns/keys
15+
owner: "{{ coredns_system_user }}"
16+
group: "{{ coredns_system_group }}"
17+
mode: 0400
18+
with_fileglob: "{{ coredns_key_files_paths }}"
19+
1120
- name: Copy zone files
1221
template:
1322
src: "{{ item }}"

tasks/install.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
mode: 0755
2525
with_items:
2626
- /etc/coredns
27+
- /etc/coredns/keys
2728
- /etc/coredns/zones
2829

2930
- block:

0 commit comments

Comments
 (0)