diff --git a/roles/paperless/templates/docker-compose.yaml.j2 b/roles/paperless/templates/docker-compose.yaml.j2 index a7bf1d0..37d5361 100644 --- a/roles/paperless/templates/docker-compose.yaml.j2 +++ b/roles/paperless/templates/docker-compose.yaml.j2 @@ -68,6 +68,7 @@ services: {% if restic_enable is not undefined and not false and stack_paperless_restic_enable is not undefined and not false %} backup: image: mazzolino/restic + hostname: "{{ ansible_hostname }}" environment: TZ: "{{ restic_tz }}" BACKUP_CRON: "{{ stack_paperless_restic_cron }}" diff --git a/roles/restic/templates/docker-compose.yaml.j2 b/roles/restic/templates/docker-compose.yaml.j2 index 3bc4489..306c522 100644 --- a/roles/restic/templates/docker-compose.yaml.j2 +++ b/roles/restic/templates/docker-compose.yaml.j2 @@ -1,8 +1,7 @@ services: prune: image: "mazzolino/restic:{{ restic_version }}" - # TODO: get actual hostname/inventoryname? put it into notifications body below too - hostname: docker + hostname: "{{ ansible_hostname }}" networks: - restic_notify environment: @@ -17,15 +16,15 @@ services: AWS_SECRET_ACCESS_KEY: "{{ restic_s3_secret }}" {% if restic_notify_success != None %} POST_COMMANDS_SUCCESS: |- - curl -X POST --data "{\"title\": \"Restic Prune successful\", \"body\": \" \"}" http://notify_success:5000 + curl -X POST --data "{\"title\": \"Restic Prune successful\", \"body\": \"{{ ansible_hostname }}\"}" http://notify_success:5000 {% endif %} {% if restic_notify_failure != None %} POST_COMMANDS_FAILURE: |- - curl -X POST --data "{\"title\": \"Restic Prune failed\", \"body\": \" \"}" http://notify_failure:5000 + curl -X POST --data "{\"title\": \"Restic Prune failed\", \"body\": \"{{ ansible_hostname }}\"}" http://notify_failure:5000 {% endif %} {% if restic_notify_exit != None %} POST_COMMANDS_EXIT: |- - curl -X POST --data "{\"title\": \"Restic Prune exited\", \"body\": \" \"}" http://notify_exit:5000 + curl -X POST --data "{\"title\": \"Restic Prune exited\", \"body\": \"{{ ansible_hostname }}\"}" http://notify_exit:5000 {% endif %} {% if restic_repo is regex('^/.+') %} volumes: @@ -49,15 +48,15 @@ services: AWS_SECRET_ACCESS_KEY: "{{ restic_s3_secret }}" {% if restic_notify_success != None %} POST_COMMANDS_SUCCESS: |- - curl -X POST --data "{\"title\": \"Restic Check successful\", \"body\": \" \"}" http://notify_success:5000 + curl -X POST --data "{\"title\": \"Restic Check successful\", \"body\": \"{{ ansible_hostname }}\"}" http://notify_success:5000 {% endif %} {% if restic_notify_failure != None %} POST_COMMANDS_FAILURE: |- - curl -X POST --data "{\"title\": \"Restic Check failed\", \"body\": \" \"}" http://notify_failure:5000 + curl -X POST --data "{\"title\": \"Restic Check failed\", \"body\": \"{{ ansible_hostname }}\"}" http://notify_failure:5000 {% endif %} {% if restic_notify_exit != None %} POST_COMMANDS_EXIT: |- - curl -X POST --data "{\"title\": \"Restic Check exited\", \"body\": \" \"}" http://notify_exit:5000 + curl -X POST --data "{\"title\": \"Restic Check exited\", \"body\": \"{{ ansible_hostname }}\"}" http://notify_exit:5000 {% endif %} {% if restic_repo is regex('^/.+') %} volumes: