diff --git a/files/etc/fancontrol-nuvoton-nct6796d-s-fans-2-4-bound-to-cpu-die-temp b/files/etc/fancontrol-nuvoton-nct6796d-s-fans-2-4-bound-to-cpu-die-temp new file mode 100644 index 0000000..3e1d2c8 --- /dev/null +++ b/files/etc/fancontrol-nuvoton-nct6796d-s-fans-2-4-bound-to-cpu-die-temp @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: MIT +# Configuration file generated by pwmconfig, changes will be lost +INTERVAL=10 +# DEVPATH=hwmon1=devices/platform/nct6775.656 +# DEVNAME=hwmon1=nct6799 +FCTEMPS=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm2=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/temp13_input /sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm4=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/temp13_input +FCFANS=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm2=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/fan2_input /sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm4=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/fan4_input +MINTEMP=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm2=70 /sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm4=70 +MAXTEMP=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm2=90 /sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm4=90 +MINSTART=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm2=100 /sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm4=100 +MINSTOP=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm2=100 /sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm4=100 +MINPWM=/sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm2=100 /sys/devices/platform/nct6775.[[:print:]]*/hwmon/hwmon[[:print:]]*/pwm4=100 diff --git a/tasks/main.yml b/tasks/main.yml index de8b85a..f2fc31c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -- import_tasks: 'mainboard-amd-am5-b650m-hdv_m.2.yml' - when: 'ansible_facts[''product_name''] | lower == ''b650m-hdv/m.2''' +- import_tasks: 'mainboard-amd-am5-b650m-hdv_m.2_and_am5-a620am_pro-a.yml' + when: 'ansible_facts[''product_name''] | lower == ''b650m-hdv/m.2'' or ansible_facts[''board_name''] | lower == ''a620am pro-a''' - import_tasks: 'mainboard-amd-am4-prime_a320i-k.yml' when: 'ansible_facts[''board_name''] | lower == ''prime a320i-k''' diff --git a/tasks/mainboard-amd-am5-b650m-hdv_m.2_and_am5-a620am_pro-a.yml b/tasks/mainboard-amd-am5-b650m-hdv_m.2_and_am5-a620am_pro-a.yml new file mode 100644 index 0000000..f7a130a --- /dev/null +++ b/tasks/mainboard-amd-am5-b650m-hdv_m.2_and_am5-a620am_pro-a.yml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: MIT +- name: 'If mainboard is ASRock B650M-HDV/M.2 or A620AM Pro-A (with Nuvoton NCT6796D-S super I/O chip) and OS is a Linux flavor install Linux-specific packages for sensors and fan control' + when: 'ansible_facts[''system''] | lower == ''linux''' + ansible.builtin.package: + name: '{{ packages_linux_sensors_all_families }}' + state: 'present' + +- name: 'If mainboard is ASRock B650M-HDV/M.2 or A620AM Pro-A (with Nuvoton NCT6796D-S super I/O chip) and ''os_family'' is ''{{ ansible_facts[''os_family''] | lower }}'' install {{ ansible_facts[''os_family''] | lower }}-specific packages for sensors and fan control' + ansible.builtin.package: + name: '{{ vars[''packages_linux_sensors_'' + ansible_facts[''os_family''] | lower] }}' + state: 'present' + +- name: 'If mainboard is ASRock B650M-HDV/M.2 (with Nuvoton NCT6796D-S super I/O chip) add fan control config' + when: 'ansible_facts[''board_name''] | lower == ''prime a320i-k''' + loop_control: + loop_var: 'file' + index_var: 'i' + label: 'Store ''{{ file.dst }}'' {{ file.purpose_human_readable }}' + loop: + - { src: 'etc/fancontrol-nuvoton-nct6796d-s-fans-2-4-5-7-bound-to-cpu-die-temp', dst: '/etc/fancontrol', purpose_human_readable: 'to supply sane fan control settings' } + ansible.builtin.copy: + src: '{{ file.src }}' + dest: '{{ file.dst }}' + notify: + - 'Restart fancontrol.service' + +- name: 'If mainboard is ASRock A620AM Pro-A (with Nuvoton NCT6796D-S super I/O chip) add fan control config' + when: 'ansible_facts[''board_name''] | lower == ''a620am pro-a''' + loop_control: + loop_var: 'file' + index_var: 'i' + label: 'Store ''{{ file.dst }}'' {{ file.purpose_human_readable }}' + loop: + - { src: 'etc/fancontrol-nuvoton-nct6796d-s-fans-2-4-bound-to-cpu-die-temp', dst: '/etc/fancontrol', purpose_human_readable: 'to supply sane fan control settings' } + ansible.builtin.copy: + src: '{{ file.src }}' + dest: '{{ file.dst }}' + notify: + - 'Restart fancontrol.service' + +- name: 'If mainboard is ASRock B650M-HDV/M.2 or A620AM Pro-A (with Nuvoton NCT6796D-S super I/O chip) add kernel module config' + loop_control: + loop_var: 'file' + index_var: 'i' + label: 'Store ''/{{ file.path }}'' {{ file.purpose_human_readable }}' + loop: + - { path: 'etc/modules-load.d/lm-sensors.conf', purpose_human_readable: 'to auto-load the ''nct6775'' kernel module on boot' } + - { path: 'etc/modprobe.d/lm-sensors.conf', purpose_human_readable: 'for the ''nct6775'' kernel module to work with this mainboard' } + ansible.builtin.copy: + src: '{{ file.path }}' + dest: '/{{ file.path }}' + notify: + - 'Reboot machine'