Role service-bind-slave: add systemd unit + timer to update icvpn bind config
This commit is contained in:
parent
31e0b6da67
commit
b0f0d63383
3 changed files with 46 additions and 0 deletions
|
@ -65,3 +65,27 @@
|
||||||
owner: admin
|
owner: admin
|
||||||
group: bind
|
group: bind
|
||||||
notify: restart bind9
|
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
|
||||||
|
|
|
@ -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
|
12
roles/service-bind-slave/templates/icvpn-dns-update.timer.j2
Normal file
12
roles/service-bind-slave/templates/icvpn-dns-update.timer.j2
Normal 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
|
Loading…
Reference in a new issue