mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Implemented System Btrfs Auto Balancer Role
This commit is contained in:
31
roles/system-btrfs-auto-balancer/tasks/main.yml
Normal file
31
roles/system-btrfs-auto-balancer/tasks/main.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
- name: pull auto-btrfs-balancer.git
|
||||
git:
|
||||
repo: "https://github.com/kevinveenbirkenbach/auto-btrfs-balancer.git"
|
||||
dest: "{{system_btrfs_auto_balancer_folder}}"
|
||||
update: yes
|
||||
ignore_errors: true
|
||||
when: run_once_system_btrfs_auto_balancer is not defined
|
||||
|
||||
- name: configure system-btrfs-auto-balancer.cymais.service
|
||||
template:
|
||||
src: system-btrfs-auto-balancer.service.j2
|
||||
dest: /etc/systemd/system/system-btrfs-auto-balancer.cymais.service
|
||||
notify: reload system-btrfs-auto-balancer.cymais.service
|
||||
when: run_once_system_btrfs_auto_balancer is not defined
|
||||
|
||||
- name: set service_name to the name of the current role
|
||||
set_fact:
|
||||
service_name: "{{ role_name }}"
|
||||
when: run_once_system_btrfs_auto_balancer is not defined
|
||||
|
||||
- name: "include role for systemd-timer for {{service_name}}"
|
||||
include_role:
|
||||
name: systemd-timer
|
||||
vars:
|
||||
on_calendar: "{{on_calendar_btrfs_auto_balancer}}"
|
||||
when: run_once_system_btrfs_auto_balancer is not defined
|
||||
|
||||
- name: run the system_btrfs_auto_balancer tasks once
|
||||
set_fact:
|
||||
run_once_system_btrfs_auto_balancer: true
|
||||
when: run_once_system_btrfs_auto_balancer is not defined
|
Reference in New Issue
Block a user