mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Shorted maintenance- to maint-
This commit is contained in:
24
roles/maint-btrfs-auto-balancer/README.md
Normal file
24
roles/maint-btrfs-auto-balancer/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# System Btrfs Auto Balancer
|
||||
|
||||
## Description
|
||||
|
||||
This role automates the management and balancing of Btrfs file systems. It clones the latest version of the [auto-btrfs-balancer](https://github.com/kevinveenbirkenbach/auto-btrfs-balancer.git) repository and configures a systemd service and timer to run the balancing script automatically.
|
||||
|
||||
## Overview
|
||||
|
||||
Optimized for automated file system management, this role:
|
||||
- Clones the auto-btrfs-balancer repository.
|
||||
- Configures a systemd service to run the balancing script.
|
||||
- Integrates a systemd timer for regular execution.
|
||||
- Notifies via systemd in case of errors during the balancing process.
|
||||
|
||||
## Purpose
|
||||
|
||||
The primary purpose of this role is to maintain optimal performance of Btrfs file systems by automating balancing tasks, ensuring efficient storage allocation and performance.
|
||||
|
||||
## Features
|
||||
|
||||
- **Repository Cloning:** Automatically fetches the latest auto-btrfs-balancer repository.
|
||||
- **Service Configuration:** Sets up a systemd service for running the balancing script.
|
||||
- **Timer Integration:** Schedules the balancing process via a systemd timer.
|
||||
- **Error Notification:** Notifies on failure using alert-compose.
|
4
roles/maint-btrfs-auto-balancer/handlers/main.yml
Normal file
4
roles/maint-btrfs-auto-balancer/handlers/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- name: "reload maint-btrfs-auto-balancer.cymais.service"
|
||||
systemd:
|
||||
name: maint-btrfs-auto-balancer.cymais.service
|
||||
daemon_reload: yes
|
25
roles/maint-btrfs-auto-balancer/meta/main.yml
Normal file
25
roles/maint-btrfs-auto-balancer/meta/main.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: "Kevin Veen-Birkenbach"
|
||||
description: "Automates the balancing of Btrfs file systems by cloning the auto-btrfs-balancer repository and configuring a systemd service and timer for regular execution."
|
||||
license: "CyMaIS NonCommercial License (CNCL)"
|
||||
license_url: "https://s.veen.world/cncl"
|
||||
company: |
|
||||
Kevin Veen-Birkenbach
|
||||
Consulting & Coaching Solutions
|
||||
https://www.veen.world
|
||||
min_ansible_version: "2.9"
|
||||
platforms:
|
||||
- name: Archlinux
|
||||
versions:
|
||||
- rolling
|
||||
galaxy_tags:
|
||||
- btrfs
|
||||
- balancing
|
||||
- filesystem
|
||||
- automation
|
||||
repository: "https://s.veen.world/cymais"
|
||||
issue_tracker_url: "https://s.veen.world/cymaisissues"
|
||||
documentation: "https://s.veen.world/cymais"
|
||||
dependencies:
|
||||
- alert-compose
|
30
roles/maint-btrfs-auto-balancer/tasks/main.yml
Normal file
30
roles/maint-btrfs-auto-balancer/tasks/main.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
- name: "pkgmgr install"
|
||||
include_role:
|
||||
name: pkgmgr-install
|
||||
vars:
|
||||
package_name: btrfs-auto-balancer
|
||||
when: run_once_system_btrfs_auto_balancer is not defined
|
||||
|
||||
- name: configure maint-btrfs-auto-balancer.cymais.service
|
||||
template:
|
||||
src: maint-btrfs-auto-balancer.service.j2
|
||||
dest: /etc/systemd/system/maint-btrfs-auto-balancer.cymais.service
|
||||
notify: reload maint-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 generic-timer for {{service_name}}"
|
||||
include_role:
|
||||
name: generic-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
|
@@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=auto balance btrfs
|
||||
OnFailure=alert-compose.cymais@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c 'btrfs-auto-balancer 90 10'
|
1
roles/maint-btrfs-auto-balancer/vars/main.yml
Normal file
1
roles/maint-btrfs-auto-balancer/vars/main.yml
Normal file
@@ -0,0 +1 @@
|
||||
system_btrfs_auto_balancer_folder: "{{path_administrator_scripts}}auto-btrfs-balancer/"
|
Reference in New Issue
Block a user