Role service-bind-slave: add systemd unit + timer to update icvpn bind config

This commit is contained in:
Tobias Hachmer 2017-10-04 00:20:50 +02:00
parent 31e0b6da67
commit b0f0d63383
3 changed files with 46 additions and 0 deletions

View file

@ -65,3 +65,27 @@
owner: admin
group: bind
notify: restart bind9
- name: write systemd unit icvpn-dns-update.service
template:
src: icvpn-dns-update.service.j2
dest: /etc/systemd/system/icvpn-dns-update.service
owner: root
group: root
mode: 0644
notify: reload systemd
- name: write systemd timer icvpn-dns-update.timer
template:
src: icvpn-dns-update.timer.j2
dest: /etc/systemd/system/icvpn-dns-update.timer
owner: root
group: root
mode: 0644
notify: reload systemd
- name: configure systemd unit/timer icvpn-dns-update
systemd:
name: icvpn-dns-update.timer
enabled: yes
state: started

View file

@ -0,0 +1,10 @@
#
# {{ ansible_managed }}
#
[Unit]
Description=Update icvpn bind configuration
[Service]
ExecStart=/home/admin/clones/backend-scripts/gen_icvpn_dns_gw.sh
User=admin
Group=admin

View file

@ -0,0 +1,12 @@
#
# {{ ansible_managed }}
#
[Unit]
Description=Timer which schedules icvpn-bind-update.service
[Timer]
OnBootSec=2h
OnUnitActiveSec=2d
[Install]
WantedBy=timers.target