diff options
Diffstat (limited to 'ansible')
-rw-r--r-- | ansible/roles/borg-client/handlers/main.yml | 2 | ||||
-rw-r--r-- | ansible/roles/borg-client/tasks/borg-client.yml | 10 | ||||
-rw-r--r-- | ansible/roles/borg-client/templates/bin/create-backup-send-email | 1 |
3 files changed, 6 insertions, 7 deletions
diff --git a/ansible/roles/borg-client/handlers/main.yml b/ansible/roles/borg-client/handlers/main.yml index 6e31199..2b4b222 100644 --- a/ansible/roles/borg-client/handlers/main.yml +++ b/ansible/roles/borg-client/handlers/main.yml @@ -1,4 +1,4 @@ -- name: systemd daemon-reload +- name: systemctl daemon-reload become: yes systemd: daemon_reload: true diff --git a/ansible/roles/borg-client/tasks/borg-client.yml b/ansible/roles/borg-client/tasks/borg-client.yml index 3d2d74a..4ddad49 100644 --- a/ansible/roles/borg-client/tasks/borg-client.yml +++ b/ansible/roles/borg-client/tasks/borg-client.yml @@ -78,6 +78,8 @@ content: | [Unit] Description=Create backup + After=network-online.target + Wants=network-online.target [Service] Type=oneshot @@ -85,10 +87,8 @@ ExecStart=-/usr/local/bin/create-backup ExecStartPost=-/usr/local/bin/create-backup-send-email root@trygvis.io SuccessExitStatus=0 1 - After=network-online.target - Wants=network-online.target notify: - - systemd daemon-reload + - systemctl daemon-reload - name: /etc/systemd/system/create-backup.timer copy: @@ -103,7 +103,7 @@ [Install] WantedBy=timers.target notify: - - systemd daemon-reload + - systemctl daemon-reload - service start create-backup.timer # TODO: remove @@ -112,4 +112,4 @@ state: absent register: create_backup_send_email_service notify: - - systemd daemon-reload + - systemctl daemon-reload diff --git a/ansible/roles/borg-client/templates/bin/create-backup-send-email b/ansible/roles/borg-client/templates/bin/create-backup-send-email index 65286b1..7665571 100644 --- a/ansible/roles/borg-client/templates/bin/create-backup-send-email +++ b/ansible/roles/borg-client/templates/bin/create-backup-send-email @@ -4,7 +4,6 @@ set -euo pipefail cd / - /usr/sbin/sendmail -t <<ERRMAIL To: $1 From: systemd <root@$HOSTNAME> |