mirror of
https://github.com/Crocmagnon/ansible.git
synced 2025-04-01 22:56:23 +02:00
parent
7d3c9dcad4
commit
9d10f5ef89
4 changed files with 110 additions and 0 deletions
playbooks
apps/files/bin
dependencies
system
3
playbooks/apps/files/bin/pcloud-to-backblaze
Executable file
3
playbooks/apps/files/bin/pcloud-to-backblaze
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
/usr/bin/rclone copy --transfers=10 --checksum pcloud:/ backblaze-pcloud-backup:gaugendre-pcloud-backup/
|
80
playbooks/dependencies/rclone.yaml
Normal file
80
playbooks/dependencies/rclone.yaml
Normal file
|
@ -0,0 +1,80 @@
|
|||
---
|
||||
- name: Setup rclone
|
||||
hosts: servers
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Install system deps
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- rclone
|
||||
- name: Create rclone config dir
|
||||
ansible.builtin.file:
|
||||
path: /home/gaugendre/.config/rclone/
|
||||
state: directory
|
||||
mode: "0775"
|
||||
- name: Write rclone.conf
|
||||
ansible.builtin.template:
|
||||
src: templates/rclone/rclone.conf.j2
|
||||
dest: /home/gaugendre/.config/rclone/rclone.conf
|
||||
mode: "0600"
|
||||
owner: gaugendre
|
||||
group: gaugendre
|
||||
vars:
|
||||
rclone_pcloud_access_token: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
31393931636333353461393962663165353939616233373630306166323364366464646236366236
|
||||
3532316638623631316637376631623033333338643163640a383030393666613664616330613038
|
||||
31343335306463346262353563613236326633656637316664353233323532623134303639623637
|
||||
3635303632393761620a326631623230623233633137323463633934386336643163376633653062
|
||||
65326239666231613332383164326632623132313566316332623239383263653566636564666335
|
||||
38613738326663343562666339353138366465613939383333343138633335623863373363323465
|
||||
396130376532643638336634313463346161
|
||||
rclone_pcloud_username: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
31306235373536353233626662396263303236386466346439393937633366393866376232336331
|
||||
6635646438306232376534333030366538633265323664610a386461363436383439343635613539
|
||||
64663361346262333830363338393637646661353666633461353236663264626537323137346566
|
||||
3265613931353837350a653566366162616233643436346433393335313232633463633462336236
|
||||
38323264346635343261323035666637326432383665313530333734626438306532
|
||||
rclone_pcloud_obscured_password: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
61383335653433326664343632373863653936633537386130393931376232313939643962313166
|
||||
6533346439343730643963346135303938323139646538620a386463626161326237313764653733
|
||||
61663232323538356333323162346564303832383666643837633338316138303330396330356536
|
||||
6536666164326261610a643863626239326465333161386466656663643237643833343365333438
|
||||
33393533336537646135616635336234313033306566663765373739626639323235343765663462
|
||||
31613633636234653965613264306534336533663336643835316330333533383136653439323937
|
||||
66646435663661636566653561323838633063353863333830343935623539663533373931653535
|
||||
62623665346132333663363937613562626538376162313436613962383565356532373139663439
|
||||
3965
|
||||
rclone_backblaze_account: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
38373439343234376561643433663663393064376163353637656634636532633737323765376566
|
||||
6533363136383063353865663231623737333330373561380a333834306439353364646338383433
|
||||
31646538386433376531313339303565316465363861323664303534313036653130643534643363
|
||||
6432336533356637320a386139386630396234306661616562316635383966633730383932353662
|
||||
64633364383538363966343538613664306436343961646431643530306563656262
|
||||
rclone_backblaze_key: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
36373439303231336137323833666564643636373261333934313561616465643365656439376136
|
||||
6131343666376137393330653033653565356636343835660a386436376130326663336239396564
|
||||
63326563353334366531383536313165313363613036366266626335623163343033643030656435
|
||||
3636646264333236640a636437623137633837323731343164633831336565323031393962346665
|
||||
37653138303333386639353161303966346638323337666435303934653139616131
|
||||
rclone_nextcloud_obscured_password: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
61303239646230396431323231313463613834323233663335373534306261303138666432373132
|
||||
3566313861383463653661366135643236636364663766330a356162373833393137316333363964
|
||||
36623666333839333037393135623963616139623936663264326462303637316130643234386331
|
||||
3638393166363430650a663137653264393736313432336637373937396636346635346638313631
|
||||
31393664663961393638333739656533326337656362386435383062653236623838336663336131
|
||||
37343035613863623666343430633134343339386461343031316233326639643731633331313738
|
||||
313562336232306234666333643931363135
|
||||
rclone_nextcloud_username: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
32393766396337306164343538393533623265313765643636633666653065623861633937353562
|
||||
3731323363616630303531656139393137386138666161340a356334613833633063346332323666
|
||||
65353537383662346331333534636333313736383532663564393230623531613839323235333632
|
||||
6639333935356466390a636665646265336134313362373238336231363537646238373361643730
|
||||
3833
|
21
playbooks/dependencies/templates/rclone/rclone.conf.j2
Normal file
21
playbooks/dependencies/templates/rclone/rclone.conf.j2
Normal file
|
@ -0,0 +1,21 @@
|
|||
[pcloud]
|
||||
type = pcloud
|
||||
token = {"access_token":"{{ rclone_pcloud_access_token }}","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
|
||||
hostname = eapi.pcloud.com
|
||||
username = {{ rclone_pcloud_username}}
|
||||
password = {{ rclone_pcloud_obscured_password }}
|
||||
|
||||
[backblaze-pcloud-backup]
|
||||
type = b2
|
||||
account = {{ rclone_backblaze_account }}
|
||||
key = {{ rclone_backblaze_key }}
|
||||
|
||||
[nextcloud]
|
||||
type = webdav
|
||||
url = https://cloud.augendre.info/remote.php/dav/files/{{ rclone_nextcloud_username }}
|
||||
vendor = nextcloud
|
||||
user = {{ rclone_nextcloud_username }}
|
||||
pass = {{ rclone_nextcloud_obscured_password }}
|
||||
|
||||
[local]
|
||||
type = local
|
|
@ -119,3 +119,9 @@
|
|||
minute: 0
|
||||
hour: 8
|
||||
job: /usr/bin/docker compose -f /mnt/data/media/docker-compose.yaml restart plex
|
||||
- name: Cron - Backup pCloud to Backblaze
|
||||
ansible.builtin.cron:
|
||||
name: Backup pCloud to Backblaze
|
||||
minute: 0
|
||||
hour: 4
|
||||
job: /mnt/data/bin/healthcheck pcloud-to-backblaze /mnt/data/bin/pcloud-to-backblaze
|
||||
|
|
Loading…
Add table
Reference in a new issue