diff --git a/host_vars/talos.yml b/host_vars/talos.yml index 5c6ff9b..47423cd 100644 --- a/host_vars/talos.yml +++ b/host_vars/talos.yml @@ -1,2 +1,3 @@ host_packages: - ffmpeg + - python3-psutil diff --git a/playbook.yml b/playbook.yml index d9097c3..cc1ceb6 100644 --- a/playbook.yml +++ b/playbook.yml @@ -71,3 +71,9 @@ remote_user: nerevar tasks: - import_tasks: tasks/tmux.yml +- name: vcmp timer + hosts: talos + become: true + remote_user: nerevar + tasks: + - import_tasks: tasks/vcmp_timer.yml diff --git a/tasks/vcmp/vcmp.service b/tasks/vcmp/vcmp.service new file mode 100644 index 0000000..2a49670 --- /dev/null +++ b/tasks/vcmp/vcmp.service @@ -0,0 +1,13 @@ +[Unit] +Description=Nocturnal Video compression + +[Service] +ExecStart=/opt/scripts/bin/vcmp -s /mnt/nocturnal/local/downloads/ -d /mnt/nocturnal/share/downloads/ -n 20 +Type=oneshot +RemainAfterExit=no +TimeoutStartSec=0 +IOSchedulingClass=idle +CPUSchedulingPolicy=idle +CPUSchedulingPriority=0 +RestrictRealtime=yes +Restart=no diff --git a/tasks/vcmp/vcmp.timer b/tasks/vcmp/vcmp.timer new file mode 100644 index 0000000..ed47673 --- /dev/null +++ b/tasks/vcmp/vcmp.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Nocturnal vcmp timer + +[Timer] +OnBootSec=5min +OnUnitActiveSec=5min + +[Install] +WantedBy=timers.target diff --git a/tasks/vcmp_timer.yml b/tasks/vcmp_timer.yml new file mode 100644 index 0000000..8e1ed53 --- /dev/null +++ b/tasks/vcmp_timer.yml @@ -0,0 +1,15 @@ +- name: Copy vcmp service files + copy: + src: "{{ item }}" + dest: /etc/systemd/system/ + mode: 0644 + with_items: + - vcmp/vcmp.service + - vcmp/vcmp.timer + +- name: Enable vcmp timer + systemd: + name: vcmp.timer + enabled: yes + state: started + daemon_reload: yes