Add live btrfs snapshot updating role
This commit is contained in:
parent
60ad70a09f
commit
9ca982641a
7 changed files with 86 additions and 0 deletions
9
roles/autoupdate/files/frib_autoupdate.service
Normal file
9
roles/autoupdate/files/frib_autoupdate.service
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Update btrfs filesystems
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/home/partimag/fri_live_upgrade/frib_update.py
|
||||||
|
|
12
roles/autoupdate/files/frib_autoupdate.timer
Normal file
12
roles/autoupdate/files/frib_autoupdate.timer
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Frib Autoupdate Timer
|
||||||
|
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=5m
|
||||||
|
OnUnitActiveSec=30m
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
|
9
roles/autoupdate/files/rsync_ucilnicesmb_d.service
Normal file
9
roles/autoupdate/files/rsync_ucilnicesmb_d.service
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=rsync D:
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/bash /mnt/ucilnice_d/skupno/porini_na_d.sh
|
||||||
|
|
12
roles/autoupdate/files/rsync_ucilnicesmb_d.timer
Normal file
12
roles/autoupdate/files/rsync_ucilnicesmb_d.timer
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Rsync D: timer
|
||||||
|
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=5m
|
||||||
|
OnUnitActiveSec=30m
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
|
4
roles/autoupdate/tasks/main.yml
Normal file
4
roles/autoupdate/tasks/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- import_tasks: main_win.yml
|
||||||
|
when: ansible_os_family == 'Windows'
|
||||||
|
- import_tasks: main_lin.yml
|
||||||
|
when: ansible_os_family == 'Debian'
|
39
roles/autoupdate/tasks/main_lin.yml
Normal file
39
roles/autoupdate/tasks/main_lin.yml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
- name: Create frib_autoupdate systemd unit
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: frib_autoupdate.service
|
||||||
|
dest: /etc/systemd/system/
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: Create frib_autoupdate timer
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: frib_autoupdate.timer
|
||||||
|
dest: /etc/systemd/system/
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: Enable frib_autoupdate timer
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
name: frib_autoupdate.timer
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
- name: Create rsync_ucilnicesmb_d systemd unit
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: rsync_ucilnicesmb_d.service
|
||||||
|
dest: /etc/systemd/system/
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: Create rsync_ucilnicesmb_d timer
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: rsync_ucilnicesmb_d.timer
|
||||||
|
dest: /etc/systemd/system/
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: Enable rsync_ucilnicesmb_d timer
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
name: rsync_ucilnicesmb_d.timer
|
||||||
|
state: started
|
||||||
|
enabled: true
|
1
roles/autoupdate/tasks/main_win.yml
Normal file
1
roles/autoupdate/tasks/main_win.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue