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 2021-11-08 00:21:58 -05:00
parent dd60b6b9ea
commit fed71d7add
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 model, used in pvc_user_configuration and grub_configuration below
cluster_hardware: default 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 package repository URL
debian_main_repository: http://ftp.debian.org/debian debian_main_repository: http://ftp.debian.org/debian
debian_security_repository: http://security.debian.org debian_security_repository: http://security.debian.org

View File

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

View File

@ -251,6 +251,7 @@
- lzop - lzop
- xz-utils - xz-utils
- haveged - haveged
- cpufrequtils
- ipmitool - ipmitool
- grub-efi - grub-efi
- plymouth - plymouth
@ -324,6 +325,21 @@
- /etc/sysctl.d/pvc.conf - /etc/sysctl.d/pvc.conf
tags: base-system 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 # sudo
- name: write the sudoers file - name: write the sudoers file
template: template:
@ -963,9 +979,10 @@
enabled: yes enabled: yes
with_items: with_items:
- acpid - acpid
- rsyslog - cpufrequtils
- postfix
- ntp - ntp
- postfix
- rsyslog
- ssh - ssh
tags: base-services 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 LANGUAGE=en_CA.UTF-8
LC_ALL=en_CA.UTF-8 LC_ALL=en_CA.UTF-8
LANG=en_CA.UTF-8 LANG=en_CA.UTF-8