--- # Disable Transparent Huge Pages (recommended for database workloads). RedHat # uses a tuned profile; Debian uses a small systemd service. - name: "Install tuned" ansible.builtin.dnf: name: "tuned" state: "latest" when: ansible_facts["os_family"] == "RedHat" - name: "Create tuned nothp_profile directory" ansible.builtin.file: path: '/etc/tuned/nothp_profile' state: "directory" mode: '0755' owner: 'root' group: 'root' when: ansible_facts["os_family"] == "RedHat" - name: "Set up nothp_profile tuned.conf file" ansible.builtin.copy: src: "./nothp_profile_tuned.conf" dest: "/etc/tuned/nothp_profile/tuned.conf" owner: "root" group: "root" mode: '0755' when: ansible_facts["os_family"] == "RedHat" - name: "Disable transparent huge pages" ansible.builtin.copy: src: "./disable-thp.service" dest: "/etc/systemd/system/disable-thp.service" owner: "root" group: "root" mode: '0755' notify: "Start THP" when: ansible_facts["os_family"] == "Debian"