Skip to content

Commit ae56691

Browse files
author
Sergei Antipov
committed
Updated working with transparent_hugepages
1 parent 4623063 commit ae56691

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

files/disable_thp.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

handlers/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515
- name: reload systemd
1616
shell: systemctl daemon-reload
1717
when: systemd.stat.exists == true and mongodb_manage_service
18+
19+
- name: restart sysfsutils
20+
service: name=sysfsutils state=restarted

tasks/configure.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,19 @@
7575
template: src=mongod.conf.j2 dest=/etc/mongod.conf backup=yes owner=root group=root mode=0644
7676
register: config_result
7777

78-
- name: Install disable_thp script
79-
copy: src=disable_thp.sh dest=/usr/local/bin/disable_thp.sh mode='u=rwx,g=rx,o=rx'
78+
- name: Install sysfsutils package
79+
apt: name=sysfsutils state=present
8080
when: ansible_os_family == 'Debian' and mongodb_disable_thp
8181

82-
- name: Disable Linux transparent hugepages now
83-
command: /usr/local/bin/disable_thp.sh
84-
when: ansible_os_family == 'Debian' and mongodb_disable_thp
85-
86-
- name: Disable Linux transparent hugepages on boot
87-
lineinfile: dest=/etc/rc.local regexp='/usr/local/bin/disable_thp.sh' line='if test -f '/usr/local/bin/disable_thp.sh'; /usr/local/bin/disable_thp.sh; fi'
82+
- name: Create sysfs config
83+
copy:
84+
src: hugepages.conf
85+
dest: /etc/sysfs.d/hugepages.conf
86+
owner: root
87+
group: root
88+
mode: 0644
8889
when: ansible_os_family == 'Debian' and mongodb_disable_thp
90+
notify: restart sysfsutils
8991

9092
- name: get pid of mongod
9193
command: pidof mongod

0 commit comments

Comments
 (0)