Optimized udev rules for backup to usb with the help of chat gpt https://chat.openai.com/share/a75ca771-d8a4-4b75-9912-c515ba371ae4

This commit is contained in:
2023-05-27 23:04:22 +02:00
parent 3341fc56ac
commit b8a23f95db
23 changed files with 86 additions and 85 deletions

View File

@@ -0,0 +1,28 @@
---
- name: Copy udev rule to the rules directory
template:
src: 99-usbstick.rules.j2
dest: /etc/udev/rules.d/
notify: Reload udev rules
- name: Copy backup script to the scripts directory
template:
src: backup-to-usb.sh.j2
dest: "{{ backup_to_usb_script_path }}"
owner: root
group: root
mode: '0755'
- name: Copy systemd service to systemd directory
template:
src: backup-to-usb.service.j2
dest: /etc/systemd/system/backup-to-usb.service
owner: root
group: root
mode: '0644'
- name: Enable and start service
systemd:
name: backup-to-usb
enabled: yes
state: started