mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
update roothints monthly
This commit is contained in:
parent
fc80e7ce2e
commit
f8893fe292
5 changed files with 42 additions and 0 deletions
|
|
@ -143,6 +143,7 @@ localtime:
|
|||
|
||||
unbound:
|
||||
tls: True
|
||||
roothints_update: trusted
|
||||
nameservers:
|
||||
- 1.1.1.1@853#cloudflare-dns.com # Cloudflare
|
||||
- 9.9.9.9@853#dns.quad9.net # Quad9
|
||||
|
|
|
|||
6
roles/unbound/files/roothints.service
Normal file
6
roles/unbound/files/roothints.service
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[Unit]
|
||||
Description=Unbound Root Hints Update Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/curl -sS -o /etc/unbound/root.hints https://www.internic.net/domain/named.cache
|
||||
11
roles/unbound/files/roothints.timer
Normal file
11
roles/unbound/files/roothints.timer
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Unbound Root Hints Update Timer
|
||||
|
||||
[Timer]
|
||||
OnCalendar=monthly
|
||||
Persistent=true
|
||||
RandomizedDelaySec=3600
|
||||
Unit=roothints.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
- name: restart unbound
|
||||
service: name=unbound state=restarted
|
||||
|
||||
- name: restart roothints
|
||||
service: name=roothints.timer state=restarted
|
||||
when: unbound.roothints_update == "all"
|
||||
|
|
|
|||
|
|
@ -40,3 +40,23 @@
|
|||
lineinfile: dest=/etc/resolvconf.conf
|
||||
state=present
|
||||
line="name_servers=127.0.0.1"
|
||||
|
||||
- name: Push Unbound root hits update service file
|
||||
copy:
|
||||
src: roothints.service
|
||||
dest: /etc/systemd/system/roothints.service
|
||||
notify:
|
||||
- reload systemd config
|
||||
|
||||
- name: Push Unbound root hits update timer file
|
||||
copy:
|
||||
src: roothints.timer
|
||||
dest: /etc/systemd/system/roothints.timer
|
||||
notify:
|
||||
- reload systemd config
|
||||
- restart roothints
|
||||
|
||||
- include_tasks: roles/nmtrust/tasks/unit.yml
|
||||
vars:
|
||||
unit: roothints.timer
|
||||
run_on: "{{ unbound.roothints_update }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue