writefreely/aws-s3-backup/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Mon, 29 Jul 2024 12:41:57 -0500
changeset 237 c6c11084c802
parent 159 05d0cf32e077
permissions -rw-r--r--
Cleaned up always-changed status tasks.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
159
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
     3
- name: create writefreely s3 backup shell script
0
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  copy:
159
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
     6
    src: "writefreely-s3-backup.sh"
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
     7
    dest: "/usr/local/bin/writefreely-s3-backup.sh"
0
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
    mode: "0755"
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
157
5e5c9e605142 Add aws s3 versioning and lifecycles to backup.
Luke Hoersten <luke@hoersten.org>
parents: 56
diff changeset
    10
- name: create s3 backup lifesycle json file
5e5c9e605142 Add aws s3 versioning and lifecycles to backup.
Luke Hoersten <luke@hoersten.org>
parents: 56
diff changeset
    11
  become: yes
5e5c9e605142 Add aws s3 versioning and lifecycles to backup.
Luke Hoersten <luke@hoersten.org>
parents: 56
diff changeset
    12
  copy:
159
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
    13
    src: "writefreely-s3-backup-lifecycle.json"
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
    14
    dest: "/usr/local/share/writefreely-s3-backup-lifecycle.json"
157
5e5c9e605142 Add aws s3 versioning and lifecycles to backup.
Luke Hoersten <luke@hoersten.org>
parents: 56
diff changeset
    15
    mode: "0755"
5e5c9e605142 Add aws s3 versioning and lifecycles to backup.
Luke Hoersten <luke@hoersten.org>
parents: 56
diff changeset
    16
159
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
    17
- name: configure writefreely s3 backup systemd service
0
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
  become: yes
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
  template:
159
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
    20
    src: "[email protected]"
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
    21
    dest: "/lib/systemd/system/writefreely-s3-backup@{{writefreely_s3_backup_bucket}}.service"
0
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
  notify: reload s3 backup service
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
159
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
    24
- name: ensure writefreely s3 backup service is started
0
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
  become: yes
159
05d0cf32e077 Added writefreely backup.
Luke Hoersten <luke@hoersten.org>
parents: 157
diff changeset
    26
  systemd: name="writefreely-s3-backup@{{writefreely_s3_backup_bucket}}.service" enabled="yes"