From a355359c13f1ca131cf87367020757eb936737a1 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 5 Dec 2024 23:21:25 +0100 Subject: [PATCH] add eau du grand lyon downloader --- playbooks/apps/paperless-ngx.yaml | 17 +++++++++++++++++ .../paperless-ngx/download-eau-du-grand-lyon.j2 | 5 +++++ .../paperless-ngx/download-free-mobile.j2 | 2 +- .../templates/paperless-ngx/download-freebox.j2 | 2 +- playbooks/system/cron.yaml | 8 ++++++++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100755 playbooks/apps/templates/paperless-ngx/download-eau-du-grand-lyon.j2 diff --git a/playbooks/apps/paperless-ngx.yaml b/playbooks/apps/paperless-ngx.yaml index 12824ef..7652426 100644 --- a/playbooks/apps/paperless-ngx.yaml +++ b/playbooks/apps/paperless-ngx.yaml @@ -55,3 +55,20 @@ 34393732633031633738313638306637366234386337383166303830353838663237636131363435 3061303733373135310a353038316532396263653033303662313661333432333239626137353261 32346530373030393566613936373535396533366663393963636536323065343136 + + downloader_eau_lyon_username: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 65653063376334393438393561633533323463643230353061633730313033303533386362313230 + 6161626436326435616461656235653331663532353734300a643830366530613336313939363562 + 36336366643837326235633031643439306535323163646563393237616331303766333435656332 + 6566393738366534320a303062383930333231323832623935343230383135363961373861623861 + 3330 + downloader_eau_lyon_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 39613235383233373765376133613439396239336434353566633365393265323831366661316439 + 3634323064383037343865323766363732623763623863360a613030633162663137376434373136 + 31353661393462663633373766353561613137626364646437613239313866383837626138663466 + 6630663164393032360a636234306466643064386436646435373930643165336265616165656537 + 39353663646664383936336162626430336164656135323063373034626332623563633731396462 + 64353036396137626439626239313530393163616336353232663133633034323830313031616366 + 396666303765396465636330343130303230 diff --git a/playbooks/apps/templates/paperless-ngx/download-eau-du-grand-lyon.j2 b/playbooks/apps/templates/paperless-ngx/download-eau-du-grand-lyon.j2 new file mode 100755 index 0000000..919a7aa --- /dev/null +++ b/playbooks/apps/templates/paperless-ngx/download-eau-du-grand-lyon.j2 @@ -0,0 +1,5 @@ +#!/bin/bash +set -euo pipefail + +pushd /mnt/data/paperless-ngx +./downloader eau-du-grand-lyon -o consume -u '{{downloader_eau_lyon_username}}' -p '{{downloader_eau_lyon_password}}' --headless diff --git a/playbooks/apps/templates/paperless-ngx/download-free-mobile.j2 b/playbooks/apps/templates/paperless-ngx/download-free-mobile.j2 index d0786c2..139e723 100755 --- a/playbooks/apps/templates/paperless-ngx/download-free-mobile.j2 +++ b/playbooks/apps/templates/paperless-ngx/download-free-mobile.j2 @@ -2,4 +2,4 @@ set -euo pipefail pushd /mnt/data/paperless-ngx -./downloader free-mobile -o consume -u {{downloader_free_mobile_username}} -p {{downloader_free_mobile_password}} --headless --no-interaction +./downloader free-mobile -o consume -u '{{downloader_free_mobile_username}}' -p '{{downloader_free_mobile_password}}' --headless --no-interaction diff --git a/playbooks/apps/templates/paperless-ngx/download-freebox.j2 b/playbooks/apps/templates/paperless-ngx/download-freebox.j2 index 7b7413d..4568916 100755 --- a/playbooks/apps/templates/paperless-ngx/download-freebox.j2 +++ b/playbooks/apps/templates/paperless-ngx/download-freebox.j2 @@ -2,4 +2,4 @@ set -euo pipefail pushd /mnt/data/paperless-ngx -./downloader freebox -o consume -u {{downloader_freebox_username}} -p {{downloader_freebox_password}} --headless +./downloader freebox -o consume -u '{{downloader_freebox_username}}' -p '{{downloader_freebox_password}}' --headless diff --git a/playbooks/system/cron.yaml b/playbooks/system/cron.yaml index 7465b52..57455a7 100644 --- a/playbooks/system/cron.yaml +++ b/playbooks/system/cron.yaml @@ -91,3 +91,11 @@ hour: 13 day: 30 job: /mnt/data/bin/healthcheck downloader /mnt/data/paperless-ngx/download-free-mobile + - name: Cron - Download Eau du Grand Lyon invoice + ansible.builtin.cron: + name: Download Eau du Grand Lyon invoice + minute: 0 + hour: 13 + day: 10 + month: "6,12" + job: /mnt/data/bin/healthcheck downloader /mnt/data/paperless-ngx/download-eau-du-grand-lyon