Add option for setting CPU governor

Allows the administrator to set a CPU frequency governor if they need
to, though the default of ondemand is usually sufficient.
This commit is contained in:
Joshua Boniface 2023-09-01 15:42:28 -04:00
parent fc5bcf139c
commit 056c325486
5 changed files with 30 additions and 2 deletions

View File

@ -19,6 +19,10 @@ recursive_dns_search_domains:
# Cluster hardware model, used in pvc_user_configuration and grub_configuration below
cluster_hardware: default
# CPU governor, sets power and performance statistics of the system CPUs; default is ondemand
# > Valid options are (usually): conservative, ondemand, powersave, userspace, performance, schedutil
cpu_governor: ondemand
# Debian package repository URL
debian_main_repository: http://ftp.debian.org/debian
debian_security_repository: http://security.debian.org

View File

@ -19,3 +19,5 @@ deploy_username: "deploy"
fail2ban_ignorelist:
- 10.0.0.0/8
cpu_governor: "ondemand"

View File

@ -251,6 +251,7 @@
- lzop
- xz-utils
- haveged
- cpufrequtils
- ipmitool
- grub-efi
- plymouth
@ -324,6 +325,21 @@
- /etc/sysctl.d/pvc.conf
tags: base-system
# cpufreq
- name: write the cpufrequtils governor
template:
src: etc/default/cpufrequtils.j2
dest: /etc/default/cpufrequtils
register: cpufrequtils
tags: base-system
- name: activate cpufrequtils governor
service:
name: cpufrequtils
state: restarted
when: cpufrequtils.changed
tags: base-system
# sudo
- name: write the sudoers file
template:
@ -963,9 +979,10 @@
enabled: yes
with_items:
- acpid
- rsyslog
- postfix
- cpufrequtils
- ntp
- postfix
- rsyslog
- ssh
tags: base-services

View File

@ -0,0 +1,3 @@
# CPU Frequency Utils configuration
# {{ ansible_managed }}
GOVERNOR="{{ cpu_governor }}"

View File

@ -1,3 +1,5 @@
# Locales configuration
# {{ ansible_managed }}
LANGUAGE=en_CA.UTF-8
LC_ALL=en_CA.UTF-8
LANG=en_CA.UTF-8