add btrfs role

This commit is contained in:
Francois Andrieu 2023-08-10 23:42:26 +02:00 committed by darknao
parent 44ce99733e
commit 03f57ae414
5 changed files with 47 additions and 1 deletions

View file

@ -31,7 +31,8 @@
when: "env == 'staging' or createrepo or 'runroot' in group_names and not inventory_hostname.startswith('buildvm-s390x')",
}
- ipa/client
- { role: sudo, when: not inventory_hostname.startswith('bkernel') and env == 'production' }
- role: sudo
when: not inventory_hostname.startswith('bkernel') and env == 'production'
- koji_builder
- role: nfs/client
mnt_dir: '/mnt/koji/ostree'
@ -85,6 +86,8 @@
host: "odcs{{ env_suffix }}.fedoraproject.org"
kt_location: /etc/kojid/secrets/odcs_inner.keytab
when: env == "staging"
- role: btrfs
btrfs_balance_period: weekly
tasks:
- import_tasks: "{{ tasks_path }}/motd.yml"

View file

@ -0,0 +1,2 @@
---
btrfs_balance_period: weekly

View file

@ -0,0 +1,5 @@
---
- name: restart btrfs-balance
service:
name: btrfs-balance.timer
state: restarted

View file

@ -0,0 +1,34 @@
---
- name: Install btrfsmaintenance package
package:
state: present
name:
- btrfsmaintenance
- name: Create /etc/systemd/system/btrfs-balance.timer.d
file:
state: directory
path: /etc/systemd/system/btrfs-balance.timer.d
owner: root
group: root
mode: 0755
- name: Configure btrfs-balance timer
template:
src: schedule.conf.j2
dest: /etc/systemd/system/btrfs-balance.timer.d/schedule.conf
owner: root
group: root
mode: 0644
notify:
- reload systemd
- restart btrfs-balance
- name: Ensure btrfs-balance is enabled and started
service:
name: btrfs-balance.timer
enabled: yes
state: started

View file

@ -0,0 +1,2 @@
[Timer]
OnCalendar={{ btrfs_balance_period }}