diff options
author | Christian Pointner <equinox@spreadspace.org> | 2024-01-28 13:37:07 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2024-01-28 13:37:07 +0100 |
commit | 1d94d5f6e3cf85f1e0be0eb6b45cc1a5f1f27b7f (patch) | |
tree | adfd17db37adb181ec8d6c259ddb0f7e7f9986b5 /roles/whawty/auth/store/tasks/sync-client.yml | |
parent | add what-auth instance to ch-apn (diff) |
whawty/auth/store: add prometheus metrics for sync
Diffstat (limited to 'roles/whawty/auth/store/tasks/sync-client.yml')
-rw-r--r-- | roles/whawty/auth/store/tasks/sync-client.yml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/roles/whawty/auth/store/tasks/sync-client.yml b/roles/whawty/auth/store/tasks/sync-client.yml index a45e4727..bbd5e8c9 100644 --- a/roles/whawty/auth/store/tasks/sync-client.yml +++ b/roles/whawty/auth/store/tasks/sync-client.yml @@ -41,7 +41,15 @@ {% endif %} {% endif %} while true; do - /usr/bin/rsync -rtW --delete --delete-delay --delay-updates --partial-dir=.tmp{{ rsync_args | join('') }} -e 'ssh -F "/etc/whawty/auth/.store-{{ item.key }}-sync/ssh_config"' 'rsync://whawty-auth-server/store' '{{ item.value.config.basedir }}' + /usr/bin/rsync -rtWi --delete --delete-delay --delay-updates --partial-dir=.tmp{{ rsync_args | join('') }} -e 'ssh -F "/etc/whawty/auth/.store-{{ item.key }}-sync/ssh_config"' 'rsync://whawty-auth-server/store' '{{ item.value.config.basedir }}' + {% if (item.value.sync.prometheus | default(False)) %} + result=$? + now=$(date +"%s") + cat <<EOF | sponge /var/lib/prometheus-node-exporter/textfile-collector/whawty-auth-store-sync-{{ item.key }}.prom + whawty_auth_store_sync_run{name="{{ item.key }}"} $now + whawty_auth_store_sync_exit_code{name="{{ item.key }}"} $result + EOF + {% endif %} sleep 60 done dest: /etc/whawty/auth/.store-{{ item.key }}-sync/run.sh |