Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@
borg_group: backupuser
```

## Using Uptime Kuma for Backup Monitoring

```
- hosts: webservers
roles:
- role: borgbase.ansible_role_borgbackup
borg_encryption_passphrase: CHANGEME
borg_repository: ssh://m5vz9gp4@m5vz9gp4.repo.borgbase.com/./repo
borgmatic_timer: systemd
borg_source_directories:
- /var/www
borgmatic_uptime_kuma_push_url: "https://example.uptime.kuma/api/push/abcd1234"
borgmatic_uptime_kuma_states:
- start
- finish
- fail
borgmatic_uptime_kuma_verify_tls: true
```

## Use service user and copy SSH key to target server

Installs and configures the Borgmatic client and also initializes the repo on the
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl
- `borgmatic_store_atime`: Store atime into archive. Defaults to `true`
- `borgmatic_store_ctime`: Store ctime into archive. Defaults to `true`
- `borgmatic_version`: Force a specific borgmatic version to be installed
- `borgmatic_uptime_kuma_push_url`: Uptime Kuma push URL for monitoring (without query string). See [Uptime Kuma documentation](https://torsion.org/borgmatic/reference/configuration/monitoring/uptime-kuma/) for more. Example: `https://example.uptime.kuma/api/push/abcd1234`
- `borgmatic_uptime_kuma_states`: List of monitoring states to push for. Defaults to `['start', 'finish', 'fail']`. Valid values are: `start`, `finish`, and `fail`.
- `borgmatic_uptime_kuma_verify_tls`: Verify the TLS certificate of the push URL host. Defaults to `true`

- `borg_user`: Name of the User to create Backups (service account)
- `borg_group`: Name of the Group to create Backups (service account)
Expand Down
8 changes: 8 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ borgmatic_relocated_repo_access_is_ok: false
borgmatic_unknown_unencrypted_repo_access_is_ok: false
borgmatic_version: ">=1.7.11"

# Uptime Kuma monitoring configuration
# borgmatic_uptime_kuma_push_url: "https://example.uptime.kuma/api/push/abcd1234"
borgmatic_uptime_kuma_states:
- start
- finish
- fail
borgmatic_uptime_kuma_verify_tls: true

borg_venv_path: "/opt/borgmatic"
borg_user: "root"
borg_group: "root"
Expand Down
18 changes: 18 additions & 0 deletions meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,21 @@ argument_specs:
type: str
required: false
description: Comment added to the SSH public key.
borgmatic_uptime_kuma_push_url:
type: str
required: false
description: |
Uptime Kuma push URL for monitoring (without query string).
Example: https://example.uptime.kuma/api/push/abcd1234
borgmatic_uptime_kuma_states:
type: list
required: false
default: ['start', 'finish', 'fail']
description: |
List of one or more monitoring states to push for: "start", "finish", and/or "fail".
Defaults to pushing for all states.
borgmatic_uptime_kuma_verify_tls:
type: bool
required: false
default: true
description: Verify the TLS certificate of the push URL host. Defaults to true.
27 changes: 27 additions & 0 deletions templates/config.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,30 @@ check_last: {{ borgmatic_check_last }}
{{ hook }}:
{{ borgmatic_hooks[hook] | to_nice_yaml(indent=4) | indent(4, first=true) }}
{% endfor %}

{% if borgmatic_uptime_kuma_push_url is defined and borgmatic_uptime_kuma_push_url %}
# Configuration for a monitoring integration with Uptime Kuma using
# the Push monitor type.
# See more information here: https://uptime.kuma.pet
uptime_kuma:
# Uptime Kuma push URL without query string (do not include the
# question mark or anything after it).
push_url: {{ borgmatic_uptime_kuma_push_url }}

{% if borgmatic_uptime_kuma_states is defined and borgmatic_uptime_kuma_states | length > 0 %}
# List of one or more monitoring states to push for: "start",
# "finish", and/or "fail". Defaults to pushing for all
# states.
states:
{% for state in borgmatic_uptime_kuma_states %}
- {{ state }}
{% endfor %}
{% endif %}

{% if borgmatic_uptime_kuma_verify_tls is defined %}
# Verify the TLS certificate of the push URL host. Defaults to
# true.
verify_tls: {{ borgmatic_uptime_kuma_verify_tls | lower }}
{% endif %}
{% endif %}