minecraft/aws-s3-backup/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 04 Feb 2024 20:27:19 -0600
changeset 227 2e0366f2dcbe
parent 164 ae19501f5251
permissions -rw-r--r--
Tons of updates to fix migration to new server.

---

- name: create minecraft s3 backup shell script
  become: yes
  copy:
    src: "minecraft-s3-backup.sh"
    dest: "/usr/local/bin/minecraft-s3-backup.sh"
    mode: "0755"

- name: create s3 backup lifesycle json file
  become: yes
  copy:
    src: "minecraft-s3-backup-lifecycle.json"
    dest: "/usr/local/share/minecraft-s3-backup-lifecycle.json"
    mode: "0755"

- name: create minecraft tar dir
  become: yes
  file:
    path: "{{minecraft_s3_backup_tar_dir}}"
    mode: "0755"
    state: "directory"

- name: configure minecraft s3 backup systemd service
  become: yes
  template:
    src: "[email protected]"
    dest: "/lib/systemd/system/minecraft-s3-backup@{{minecraft_s3_backup_world_name}}.service"
  notify: reload s3 backup service

- name: ensure minecraft s3 backup service is started
  become: yes
  systemd: name="minecraft-s3-backup@{{minecraft_s3_backup_world_name}}.service" enabled="yes"