infrastructure/ansible/roles/s3_sync/tasks/main.yml
Jake Howard d5a7a61171
All checks were successful
/ terraform (push) Successful in 38s
/ ansible (push) Successful in 1m30s
Remove unnecessary use of become from some roles
This should make execution much faster
2024-09-09 17:09:03 +01:00

46 lines
983 B
YAML

- name: Include vault
include_vars: vault.yml
- name: Install rclone
package:
name: rclone
- name: Install runitor
kewlfft.aur.aur:
name: runitor-bin
- name: Make user
user:
name: rclone
shell: /bin/nologin
system: false
register: rclone_user
- name: Create config directory
file:
path: "{{ rclone_user.home }}/.config/rclone"
state: directory
owner: rclone
mode: "0700"
- name: Install rclone config
template:
src: files/rclone.conf
dest: "{{ rclone_user.home }}/.config/rclone/rclone.conf"
owner: rclone
mode: "0600"
- name: Create config directory
file:
path: "{{ rclone_user.home }}/sync"
state: directory
owner: rclone
mode: "0700"
- name: Schedule sync
cron:
name: Sync terraform state
hour: 23
minute: 0
job: CHECK_UUID={{ vault_healthchecks_id }} /usr/bin/runitor -- /usr/bin/rclone sync s3:0rng-terraform {{ rclone_user.home }}/sync/0rng-terraform
user: rclone