Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions roles/mongodb/tasks/disable-thp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,22 @@

- name: Install and configure tuned
when: ansible_distribution_file_variety == "RedHat"
vars:
# TuneD 2.27 (EL10) only searches /etc/tuned/profiles for custom profiles
mongodb_tuned_profile_dir: "{{ '/etc/tuned/profiles' if ansible_distribution_major_version is version('10', '>=') else '/etc/tuned' }}/virtual-guest-no-thp"
block:
- name: Create custom tuned profile directory
ansible.builtin.file:
state: directory
path: "/etc/tuned/virtual-guest-no-thp"
path: "{{ mongodb_tuned_profile_dir }}"
owner: root
group: root
mode: "0755"

- name: Ensure tuned does not re-enable THP
ansible.builtin.template:
src: tuned.conf.j2
dest: "/etc/tuned/virtual-guest-no-thp/tuned.conf"
dest: "{{ mongodb_tuned_profile_dir }}/tuned.conf"
owner: root
group: root
mode: "0644"
Expand Down
2 changes: 1 addition & 1 deletion roles/mongodb/tasks/enable-thp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
when: ansible_distribution_file_variety == "RedHat"
vars:
# TuneD 2.27 (EL10) only searches /etc/tuned/profiles for custom profiles
mongodb_tuned_profile_dir: "{{ '/etc/tuned/profiles' if ansible_distribution_major_version == '10' else '/etc/tuned' }}/virtual-guest-no-thp"
mongodb_tuned_profile_dir: "{{ '/etc/tuned/profiles' if ansible_distribution_major_version is version('10', '>=') else '/etc/tuned' }}/virtual-guest-no-thp"
block:
- name: Create custom tuned profile directory
ansible.builtin.file:
Expand Down
2 changes: 1 addition & 1 deletion roles/mongodb/tasks/install-mongodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
- ansible_facts.selinux.status == 'enabled'
- ansible_facts.selinux.mode == 'enforcing'
# EL10 selinux-policy has no MongoDB domain (mongod_t), so there is nothing to extend
- ansible_distribution_major_version != '10'
- ansible_distribution_major_version is version('10', '<')

- name: Configure logrotate for MongoDB
ansible.builtin.include_tasks:
Expand Down
7 changes: 5 additions & 2 deletions roles/redis/tasks/disable-thp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,22 @@
when:
- ansible_distribution_file_variety == "RedHat"
- tuned_installed.rc == 0
vars:
# TuneD 2.27 (EL10) only searches /etc/tuned/profiles for custom profiles
redis_tuned_profile_dir: "{{ '/etc/tuned/profiles' if ansible_distribution_major_version is version('10', '>=') else '/etc/tuned' }}/virtual-guest-no-thp"
block:
- name: Create custom tuned profile directory
ansible.builtin.file:
state: directory
path: "/etc/tuned/virtual-guest-no-thp"
path: "{{ redis_tuned_profile_dir }}"
owner: root
group: root
mode: "0755"

- name: Ensure tuned does not re-enable THP
ansible.builtin.template:
src: tuned.conf.j2
dest: "/etc/tuned/virtual-guest-no-thp/tuned.conf"
dest: "{{ redis_tuned_profile_dir }}/tuned.conf"
owner: root
group: root
mode: "0644"
Expand Down
Loading