Ansible Pilot

Reduce Intel Laptop CPU Temperature Overheating In Linux - ansible module package and Thermald

How to reduce Intel laptop CPU Temperature overheating using Ansible Playbook with package module and zero-configuration Linux thermal daemon (thermald).

July 19, 2022
Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons

How to Reduce Laptop CPU Temperature Overheating In Linux?

I’m going to show you a live demo and some simple Ansible code.

I’m Luca Berton and welcome to today’s episode of Ansible Pilot.

Reduce Intel Laptop CPU Temperature Overheating In Linux

Today we’re talking about the open source project “Linux thermal daemon” (thermald) that monitors and controls the temperature in laptops, tablets PC with the latest Intel sandy bridge and latest Intel CPU releases.

The thermald tool operates in two modes:

For most users, this should be enough to bring the CPU temperature of the system under control. This uses a DTS temperature sensor and uses Intel P state driver, Power clamp driver, Running Average Power Limit control, and cpufreq as cooling methods.

This allows ACPI-style configuration in a thermal XML configuration file. This can be used to fix the buggy ACPI configuration or fine-tune it by adding more sensors and cooling devices. This is the first step in implementing a close loop thermal control in user mode and can be enhanced based on community feedback and suggestions.

It’s available as a package “thermald” for the most used distribution today.

Please note that this service might degrade laptop performance byslowing the CPU.

Ansible Install a package in Linux

The full name is ansible.builtin.package, which means it is part of the collection of modules “builtin” with ansible and shipped with it.

These modules are pretty stable and out for years.

Its purpose is to act as a Generic OS package manager.

Parameters

In the name parameter you are going to specify the name of the package or the specific version you would like to install.

The state specifies the action that we would like to perform. In our case install is “present or installed”.

The Best Resources For Ansible

Video Course

Books

demo

Let’s jump into a real-life playbook to install the thermald package and start the zero-configuration service in Linux using the Ansible Playbook.

code

---
- name: thermald demo
  hosts: all
  become: true
  tasks:
    - name: thermald installed
      ansible.builtin.package:
        name: thermald
        state: present

    - name: thermald running
      ansible.builtin.service:
        name: thermald
        state: started
        enabled: true

execution

ansible-pilot $ ansible-playbook -i virtualmachines/demo/inventory thermald.yml
PLAY [thermald demo] **************************************************************************************
TASK [Gathering Facts] ************************************************************************************
ok: [demo.example.com]
TASK [thermald installed] *********************************************************************************
changed: [demo.example.com]
TASK [thermald running] ***********************************************************************************
changed: [demo.example.com]
PLAY RECAP ************************************************************************************************
demo.example.com           : ok=3    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

idempotency

ansible-pilot $ ansible-playbook -i virtualmachines/demo/inventory thermald.yml
PLAY [thermald demo] **************************************************************************************
TASK [Gathering Facts] ************************************************************************************
ok: [demo.example.com]
TASK [thermald installed] *********************************************************************************
ok: [demo.example.com]
TASK [thermald running] ***********************************************************************************
ok: [demo.example.com]
PLAY RECAP ************************************************************************************************
demo.example.com           : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

before execution

[[email protected] devops]# dnf list thermald
Updating Subscription Management repositories.
Available Packages
thermald.x86_64                    2.4.6-1.el8                     rhel-8-for-x86_64-appstream-rpms
[[email protected] devops]#

after execution

[[email protected] devops]# dnf list thermald
Updating Subscription Management repositories.
Installed Packages
thermald.x86_64                        2.4.6-1.el8                        @rhel-8-for-x86_64-appstream-rpms

code with ❤️ in GitHub

Recap

Now you know how to reduce Intel Laptop CPU Temperature Overheating In Linux using the ansible module package and Thermald. Subscribe to the YouTube channel, Medium, Website, Twitter, and Substack to not miss the next episode of the Ansible Pilot.

Academy

Learn the Ansible automation technology with some real-life examples in my

My book Ansible By Examples: 200+ Automation Examples For Linux and Windows System Administrator and DevOps

BUY the Complete PDF BOOK to easily Copy and Paste the 200+ Ansible code

Want to keep this project going? Please donate

Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons
Trustpilot
Follow me

Subscribe not to miss any new releases

FREE Top 10 Best Practices

Top 10 Best Practices of Ansible Automation: save time, reduce errors and stress