Merge branch 'duhast-master'

This commit is contained in:
Sergei Antipov 2015-04-16 22:53:08 +06:00
commit 65f92c9564
4 changed files with 25 additions and 0 deletions

View File

@ -14,6 +14,7 @@ mongodb_package: mongodb-org
mongodb_force_wait_for_port: false # When not forced, the role will wait for mongod port to become available only with systemd mongodb_force_wait_for_port: false # When not forced, the role will wait for mongod port to become available only with systemd
mongodb_pymongo_from_pip: false # Install latest PyMongo via PIP or package manager mongodb_pymongo_from_pip: false # Install latest PyMongo via PIP or package manager
mongodb_disable_thp: true
mongodb_manage_service: true mongodb_manage_service: true

View File

@ -3,6 +3,7 @@
mongodb_package: mongodb-org mongodb_package: mongodb-org
mongodb_force_wait_for_port: false mongodb_force_wait_for_port: false
mongodb_pymongo_from_pip: false # Install latest PyMongo via PIP or package manager mongodb_pymongo_from_pip: false # Install latest PyMongo via PIP or package manager
mongodb_disable_thp: true
mongodb_manage_service: true mongodb_manage_service: true

11
files/disable_thp.sh Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
if test -f /sys/kernel/mm/transparent_hugepage/khugepaged/defrag; then
echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi

View File

@ -60,6 +60,18 @@
template: src=mongod.conf.j2 dest=/etc/mongod.conf backup=yes owner=root group=root mode=0644 template: src=mongod.conf.j2 dest=/etc/mongod.conf backup=yes owner=root group=root mode=0644
register: config_result register: config_result
- name: Install disable_thp script
copy: src=disable_thp.sh dest=/usr/local/bin/disable_thp.sh mode='u=rwx,g=rx,o=rx'
when: ansible_os_family == 'Debian' and mongodb_disable_thp
- name: Disable Linux transparent hugepages now
command: /usr/local/bin/disable_thp.sh
when: ansible_os_family == 'Debian' and mongodb_disable_thp
- name: Disable Linux transparent hugepages on boot
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'
when: ansible_os_family == 'Debian' and mongodb_disable_thp
- name: get pid of mongod - name: get pid of mongod
command: pidof mongod command: pidof mongod
register: mongod_new_pid register: mongod_new_pid