mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-15 08:30:46 +02:00
41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
- block:
|
||
- name: Include dependencies
|
||
include_role:
|
||
name: '{{ item }}'
|
||
loop:
|
||
- sys-cln-bkps-service
|
||
- sys-lock
|
||
- include_tasks: utils/run_once.yml
|
||
when: run_once_svc_bkp_loc_2_usb is not defined
|
||
|
||
- name: Fail if any backup_to_usb variable is empty
|
||
assert:
|
||
that:
|
||
- backup_to_usb_mount != ""
|
||
- backup_to_usb_target != ""
|
||
- backup_to_usb_source != ""
|
||
fail_msg: |
|
||
One or more of the configuration variables are empty!
|
||
Please set:
|
||
- mount
|
||
- target
|
||
- source
|
||
to non‑empty values in your configuration file.
|
||
|
||
- name: Copy backup script to the scripts directory
|
||
copy:
|
||
src: svc-bkp-loc-2-usb.py
|
||
dest: "{{ backup_to_usb_script_path }}"
|
||
owner: root
|
||
group: root
|
||
mode: '0755'
|
||
|
||
- name: Copy systemd service to systemd directory
|
||
template:
|
||
src: svc-bkp-loc-2-usb.service.j2
|
||
dest: /etc/systemd/system/svc-bkp-loc-2-usb.infinito.service
|
||
owner: root
|
||
group: root
|
||
mode: '0644'
|
||
notify: reload svc-bkp-loc-2-usb.infinito.service
|