Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ba8b312bf2 |
@@ -68,3 +68,23 @@
|
||||
group: "svadmins"
|
||||
mode: "0770"
|
||||
become: true
|
||||
|
||||
- name: Deploy btrfs scrub service and timer
|
||||
ansible.builtin.template:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/systemd/app/btrfs/{{ item }}.j2"
|
||||
dest: "/etc/systemd/system/{{ item }}"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
loop:
|
||||
- "btrfs-scrub.service"
|
||||
- "btrfs-scrub.timer"
|
||||
become: true
|
||||
|
||||
- name: Enable auto btrfs scrub
|
||||
ansible.builtin.systemd:
|
||||
name: "btrfs-scrub.timer"
|
||||
state: "started"
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
become: true
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=BTRFS auto scrub
|
||||
ConditionPathIsMountPoint={{ node['home_path'] }}/data
|
||||
RequiresMountsFor={{ node['home_path'] }}/data
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/btrfs scrub start -Bd {{ node['home_path'] }}/data
|
||||
Nice=19
|
||||
IOSchedulingClass=idle
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Monthly BTRFS auto scrub
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-01 04:00:00
|
||||
Persistent=true
|
||||
RandomizedDelaySec=300
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user