Files
bc250-cachyos-handheld/roles/cpu_governor/tasks/main.yml
T
2026-08-26 11:24:56 +02:00

81 lines
1.8 KiB
YAML

- name: Install build and runtime prerequisites
become: true
community.general.pacman:
name:
- git
- python-pipx
state: present
- name: Check whether bc250-apply is already installed
ansible.builtin.command:
argv:
- which
- bc250-apply
register: bc250_apply
changed_when: false
failed_when: false
- name: Install bc250_smu_oc
when: bc250_apply.rc != 0
block:
- name: Create temporary dir for the checkout
ansible.builtin.tempfile:
state: directory
suffix: smuoc
register: smu_tmp
- name: Clone bc250_smu_oc
ansible.builtin.git:
repo: https://github.com/bc250-collective/bc250_smu_oc.git
dest: "{{ smu_tmp.path }}/bc250_smu_oc"
version: main
# pipx keeps this out of the system python environment.
- name: Install the CLI system-wide
become: true
ansible.builtin.command:
argv:
- pipx
- install
- --global
- "{{ smu_tmp.path }}/bc250_smu_oc"
always:
- name: Remove temporary directory
become: true
ansible.builtin.file:
path: "{{ smu_tmp.path }}"
state: absent
when: smu_tmp.path is defined
- name: Create the config directory
become: true
ansible.builtin.file:
path: /etc/bc250
state: directory
mode: '0755'
- name: Deploy the overclock profile
become: true
ansible.builtin.template:
src: overclock.conf.j2
dest: /etc/bc250/overclock.conf
mode: '0644'
register: oc_conf
- name: Install the overclock service
become: true
ansible.builtin.command:
argv:
- bc250-apply
- --install
- /etc/bc250/overclock.conf
when: oc_conf.changed
- name: Enable the overclock service at boot
become: true
ansible.builtin.systemd_service:
name: bc250-smu-oc
enabled: true
state: started