From 88154ebebdfb38c9eab6df5d5f2b79bbf679ba15 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 5 Dec 2024 00:54:49 +0100 Subject: [PATCH] add download script --- playbooks/apps/paperless-ngx.yaml | 15 +++++++++++++++ .../templates/paperless-ngx/download-freebox.j2 | 5 +++++ playbooks/system/cron.yaml | 7 +++++++ 3 files changed, 27 insertions(+) create mode 100755 playbooks/apps/templates/paperless-ngx/download-freebox.j2 diff --git a/playbooks/apps/paperless-ngx.yaml b/playbooks/apps/paperless-ngx.yaml index 8b08197..7d62213 100644 --- a/playbooks/apps/paperless-ngx.yaml +++ b/playbooks/apps/paperless-ngx.yaml @@ -25,3 +25,18 @@ 30333564313630346661333931623266313465333665343930383438353961376437343637646364 6532666134663636660a656537363262646437366135353661656264356337643039363439353731 3930 + + downloader_freebox_username: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 33636161363132333137313536613165393466303436306130376264383834663439346366383765 + 6335636531666539376439383435363430613638383263370a613661386636366534626564393732 + 35666137373762323438376666303337363332653865316534383338616432326663303734376364 + 3361663038633835610a356536373832663661333234663564323863383032613035646262633065 + 3736 + downloader_freebox_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 36376537343534363661356264326638636364333737653239363433326139303731366131393662 + 6330303263383739393935623132643431623764316265300a636563303239343432633332643939 + 63373965316165353930343966333337393136633239396261353566633638386331646631393730 + 3266386637653732640a393538346532353332333530303338636439653432323131643864356337 + 66646165376330643132653333393730643337356639613862616430623635376238 diff --git a/playbooks/apps/templates/paperless-ngx/download-freebox.j2 b/playbooks/apps/templates/paperless-ngx/download-freebox.j2 new file mode 100755 index 0000000..7b7413d --- /dev/null +++ b/playbooks/apps/templates/paperless-ngx/download-freebox.j2 @@ -0,0 +1,5 @@ +#!/bin/bash +set -euo pipefail + +pushd /mnt/data/paperless-ngx +./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 382ff3a..b4afc59 100644 --- a/playbooks/system/cron.yaml +++ b/playbooks/system/cron.yaml @@ -77,3 +77,10 @@ name: Dump voyages-lois.augendre.info minute: 57 job: /mnt/data/bin/healthcheck dump-voyages-lois-augendre-info /mnt/data/bin/dump-voyages-lois.augendre.info + - name: Cron - Download Freebox invoice + ansible.builtin.cron: + name: Download Freebox invoice + minute: 0 + hour: 13 + day: 5 + job: /mnt/data/bin/healthcheck download-freebox /mnt/data/paperless-ngx/download-freebox