lnd-channel-s3-backup/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Mon, 05 Jul 2021 10:46:30 -0500
changeset 19 5c8335b57353
permissions -rw-r--r--
Added lnd channel backup to s3 role.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
# https://gist.github.com/alexbosworth/2c5e185aedbdac45a03655b709e255a3
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
- name: install lnd-channel s3 backup apt packages
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
  become: yes
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
  apt: name="inotify-tools"
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
- name: create lnd-channel s3 backup shell script
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
  become: yes
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
  copy:
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
    src: "lnd-channel-s3-backup.sh"
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
    dest: "/usr/local/bin/lnd-channel-s3-backup.sh"
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
    mode: "0755"
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
- name: configure lnd-channel s3 backup systemd service
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
  become: yes
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
  template:
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
    src: "[email protected]"
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
    dest: "/lib/systemd/system/lnd-channel-s3-backup@{{lnd_channel_s3_backup_bucket}}.service"
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
  notify: reload s3 backup service
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
- name: ensure lnd-channel s3 backup service is started
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
  become: yes
5c8335b57353 Added lnd channel backup to s3 role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
  systemd: name="lnd-channel-s3-backup@{{lnd_channel_s3_backup_bucket}}.service" enabled="yes"