aws-s3-backup/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Mon, 08 Aug 2022 21:16:41 -0500
changeset 183 b31ef0e10cad
parent 144 267d58c0e186
child 238 bdbc88cb5078
permissions -rw-r--r--
Added Dendrite symlink to port workaround.

---

- name: apt install pip
  become: yes
  apt: name="python3-pip"

- name: pip install aws cli packages
  become: yes
  pip: name="{{aws_s3_backup_pip_packages}}"

- name: create aws config dir for root
  become: yes
  file: path="/root/.aws/" state="directory" mode="0700"

- name: configure aws credentials for root
  become: yes
  template: src="aws-{{item}}.j2" dest="/root/.aws/{{item}}" mode="0600"
  loop:
    - "credentials"
    - "config"

- name: create systemd target
  become: yes
  copy:
    src: "aws-s3-backup.target"
    dest: "/lib/systemd/system/aws-s3-backup.target"
  notify: reload target

- name: create systemd timer
  become: yes
  copy:
    src: "aws-s3-backup.timer"
    dest: "/lib/systemd/system/aws-s3-backup.timer"
  notify: reload timer

- name: ensure timer is started
  become: yes
  systemd: name="aws-s3-backup.timer" enabled="yes" state="started"