diff --git a/roles/autoupdate/files/frib_autoupdate.service b/roles/autoupdate/files/frib_autoupdate.service new file mode 100644 index 0000000..dce8afd --- /dev/null +++ b/roles/autoupdate/files/frib_autoupdate.service @@ -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 + diff --git a/roles/autoupdate/files/frib_autoupdate.timer b/roles/autoupdate/files/frib_autoupdate.timer new file mode 100644 index 0000000..580a7f6 --- /dev/null +++ b/roles/autoupdate/files/frib_autoupdate.timer @@ -0,0 +1,12 @@ +[Unit] +Description=Frib Autoupdate Timer + + +[Timer] +OnBootSec=5m +OnUnitActiveSec=30m +Persistent=true + +[Install] +WantedBy=timers.target + diff --git a/roles/autoupdate/files/rsync_ucilnicesmb_d.service b/roles/autoupdate/files/rsync_ucilnicesmb_d.service new file mode 100644 index 0000000..29e830e --- /dev/null +++ b/roles/autoupdate/files/rsync_ucilnicesmb_d.service @@ -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 + diff --git a/roles/autoupdate/files/rsync_ucilnicesmb_d.timer b/roles/autoupdate/files/rsync_ucilnicesmb_d.timer new file mode 100644 index 0000000..ad6cae5 --- /dev/null +++ b/roles/autoupdate/files/rsync_ucilnicesmb_d.timer @@ -0,0 +1,12 @@ +[Unit] +Description=Rsync D: timer + + +[Timer] +OnBootSec=5m +OnUnitActiveSec=30m +Persistent=true + +[Install] +WantedBy=timers.target + diff --git a/roles/autoupdate/tasks/main.yml b/roles/autoupdate/tasks/main.yml new file mode 100644 index 0000000..3077b7e --- /dev/null +++ b/roles/autoupdate/tasks/main.yml @@ -0,0 +1,4 @@ +- import_tasks: main_win.yml + when: ansible_os_family == 'Windows' +- import_tasks: main_lin.yml + when: ansible_os_family == 'Debian' diff --git a/roles/autoupdate/tasks/main_lin.yml b/roles/autoupdate/tasks/main_lin.yml new file mode 100644 index 0000000..1e9ecd0 --- /dev/null +++ b/roles/autoupdate/tasks/main_lin.yml @@ -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 diff --git a/roles/autoupdate/tasks/main_win.yml b/roles/autoupdate/tasks/main_win.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/roles/autoupdate/tasks/main_win.yml @@ -0,0 +1 @@ +