feat: add initial setup for pearl server
This commit is contained in:
parent
2ae759025c
commit
824d7b8a12
14 changed files with 329 additions and 34 deletions
56
roles/any.tools.restic/tasks/main.yml
Normal file
56
roles/any.tools.restic/tasks/main.yml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
- name: Ensure download directory is present
|
||||
ansible.builtin.file:
|
||||
path: "/opt/restic/{{ restic_version }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Ensure compressed binary is downloaded
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_linux_arm64.bz2"
|
||||
dest: "/opt/restic/{{ restic_version }}/restic-{{ restic_version }}.bz2"
|
||||
register: res
|
||||
|
||||
- name: Ensure binary is decompressed
|
||||
ansible.builtin.shell:
|
||||
cmd: "bunzip2 -k /opt/restic/{{ restic_version }}/restic-{{ restic_version }}.bz2"
|
||||
when: 'res.changed'
|
||||
|
||||
- name: Ensure binary is copied to correct location
|
||||
ansible.builtin.copy:
|
||||
src: "/opt/restic/{{ restic_version }}/restic-{{ restic_version }}"
|
||||
remote_src: true
|
||||
dest: '/usr/local/bin/restic'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0755'
|
||||
when: 'res.changed'
|
||||
|
||||
# - name: Ensure backup scripts directory is present
|
||||
# ansible.builtin.file:
|
||||
# path: '/etc/backups'
|
||||
# state: directory
|
||||
# mode: '0755'
|
||||
|
||||
# - name: Ensure Restic backups password file is present
|
||||
# ansible.builtin.copy:
|
||||
# src: 'restic_backups_passwd'
|
||||
# dest: '/etc/backups/restic_backups_passwd'
|
||||
# owner: root
|
||||
# group: root
|
||||
# mode: '0600'
|
||||
|
||||
# - name: Ensure backup-all script is present
|
||||
# ansible.builtin.template:
|
||||
# src: "backup-all.sh.j2"
|
||||
# dest: '/etc/backups/backup-all.sh'
|
||||
# owner: root
|
||||
# group: root
|
||||
# mode: '0644'
|
||||
|
||||
# - name: Ensure backup cronjob is enabled
|
||||
# ansible.builtin.cron:
|
||||
# name: 'Perform nightly backups'
|
||||
# minute: '0'
|
||||
# hour: '2'
|
||||
# job: '/usr/bin/bash /etc/backups/backup-all.sh'
|
||||
Loading…
Add table
Add a link
Reference in a new issue