coredns/etc/systemd/system/copy_coredns.service

16 lines
497 B
SYSTEMD
Raw Normal View History

2022-08-26 02:52:21 +02:00
[Unit]
Description=Copy TLS certs for coredns.service
2022-08-26 02:52:21 +02:00
# technically, the below should have no impact
After=network.target
PartOf=coredns.service
ConditionPathExists=/etc/letsencrypt/live/dns.dotya.ml
2022-08-26 02:52:21 +02:00
[Service]
Type=oneshot
Environment=DOMAIN=dns.dotya.ml
2022-08-26 02:52:21 +02:00
ExecStartPre=bash -c "mkdir -pv /var/lib/coredns/certs"
ExecStart=bash -c "cp -f -v --dereference /etc/letsencrypt/live/${DOMAIN}/* /var/lib/coredns/certs/"
ExecStopPost=bash -c "chown -Rv coredns:root /var/lib/coredns"
SuccessExitStatus=0