machine_setup/ansible/roles/cpu/tasks/freebsd_intel.yaml
2024-04-28 15:08:36 -04:00

82 lines
1.8 KiB
YAML

- name: Install packages
package:
name:
- lscpu # need to kldload cpuctl
- powermon # need to kldload cpuctl
- cpu-microcode-intel
state: present
- name: Install loader.conf
copy:
src: "files/{{ item }}_loader.conf"
dest: "/boot/loader.conf.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
loop:
- coretemp
- cpuctl
- aesni
- intel_microcode
- name: Install service configuration
copy:
src: "files/{{ item }}_rc.conf"
dest: "/etc/rc.conf.d/{{ item }}"
mode: 0644
owner: root
group: wheel
loop:
- power_profile
- name: Install packages
when: hwpstate is defined and not hwpstate
package:
name:
- powerdxx
state: present
- name: Install service configuration
when: hwpstate is defined and not hwpstate
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: powerdxxrc.conf
dest: /etc/rc.conf.d/powerdxx
- name: Favor energy efficiency for Speed Shift
when: hwpstate is defined and hwpstate and cores is defined
sysctl:
name: "dev.hwpstate_intel.{{ item }}.epp"
value: 100
state: present
sysctl_file: "/etc/sysctl.conf.local"
loop: "{{ range(0, cores, 1)|list }}"
- name: Install scripts
when: hwpstate is defined and hwpstate
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: cpu_set_perf_perc_freebsd
dest: /usr/local/bin/cpu_set_perf_perc
- name: Install loader.conf
when: hwpstate is defined and hwpstate
copy:
src: "files/{{ item }}_loader.conf"
dest: "/boot/loader.conf.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
loop:
- per_core_hwpstate