style: make ansible-lint happier
This commit is contained in:
@@ -1,16 +1,18 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: download restic
|
- name: Download restic
|
||||||
get_url:
|
ansible.builtin.get_url:
|
||||||
url: "{{ restic_download_url }}"
|
url: "{{ restic_download_url }}"
|
||||||
dest: "/tmp"
|
dest: "/tmp"
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
- name: uncompress restic
|
- name: Uncompress restic
|
||||||
shell:
|
ansible.builtin.command:
|
||||||
cmd: "bzip2 -dc /tmp/restic_{{ restic_version }}_{{ restic_system }}_{{ restic_architecture }}.bz2 > {{ restic_path }}"
|
cmd: "bzip2 -dc /tmp/restic_{{ restic_version }}_{{ restic_system }}_{{ restic_architecture }}.bz2 > {{ restic_path }}"
|
||||||
|
changed_when: true
|
||||||
|
|
||||||
- name: check restic exe
|
- name: Check restic exe
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ restic_path }}"
|
path: "{{ restic_path }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
owner: root
|
owner: root
|
||||||
|
@@ -1,29 +1,29 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
## TEMP
|
## TEMP
|
||||||
- name: remove borg
|
- name: Remove borg
|
||||||
include_tasks: remove_borg.yml
|
ansible.builtin.include_tasks: remove_borg.yml
|
||||||
|
|
||||||
- name: install restic
|
- name: Install restic
|
||||||
include_tasks: install.yml
|
ansible.builtin.include_tasks: install.yml
|
||||||
|
|
||||||
- name: put backup script
|
- name: Put backup script
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: resticbackup.sh.j2
|
src: resticbackup.sh.j2
|
||||||
dest: "{{ restic_script_path }}"
|
dest: "{{ restic_script_path }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0750'
|
mode: '0750'
|
||||||
|
|
||||||
- name: cron the backup script
|
- name: Cron the backup script
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: "restic backup script"
|
name: "restic backup script"
|
||||||
hour: "{{ restic_backup_hour }}"
|
hour: "{{ restic_backup_hour }}"
|
||||||
minute: "{{ restic_backup_minute }}"
|
minute: "{{ restic_backup_minute }}"
|
||||||
job: "{{ restic_script_path }}"
|
job: "{{ restic_script_path }}"
|
||||||
|
|
||||||
- name: init restic
|
- name: Init restic
|
||||||
shell:
|
ansible.builtin.command:
|
||||||
cmd: "restic init && restic stats"
|
cmd: "restic init && restic stats"
|
||||||
creates: "/root/.cache/restic"
|
creates: "/root/.cache/restic"
|
||||||
environment:
|
environment:
|
||||||
|
@@ -1,24 +1,24 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: remove borg packet
|
- name: Remove borg packet
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: borgbackup
|
name: borgbackup
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: remove borg script
|
- name: Remove borg script
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /usr/local/bin/borgbackup.sh
|
path: /usr/local/bin/borgbackup.sh
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: remove cache dirs
|
- name: Remove cache dirs
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop:
|
loop:
|
||||||
- "/root/.cache/borg"
|
- "/root/.cache/borg"
|
||||||
- "/root/.config/borg"
|
- "/root/.config/borg"
|
||||||
|
|
||||||
- name: remove cron
|
- name: Remove cron
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: "borg backup script"
|
name: "borg backup script"
|
||||||
state: absent
|
state: absent
|
||||||
|
Reference in New Issue
Block a user