# SPDX-License-Identifier: MIT - name: 'If mainboard is ASRock B650M-HDV/M.2 (with Nuvoton NCT6796D-S SuperIO chip) and OS is a Linux flavor and 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 (with Nuvoton NCT6796D-S SuperIO 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 SuperIO chip) add fan control config' loop_control: loop_var: 'file' index_var: 'i' label: 'Store ''{{ file.dst }}'' {{ file.purpose_human_readable }}' loop: - { src: 'etc/fancontrol-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 B650M-HDV/M.2 (with Nuvoton NCT6796D-S SuperIO 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'