Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux tuning #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
31 changes: 20 additions & 11 deletions configure_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
user: root

tasks:
- name: add script blob to disable THP on boot
blockinfile:
path: /etc/rc.local
insertbefore: "exit 0"
block: |
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
- name: disable THP on boot via grub
lineinfile:
path: /etc/default/grub
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT='
line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash transparent_hugepage=never"'
notify: update grub

- name: set splunk ulimit fd
blockinfile:
path: /etc/security/limits.d/splunk.conf
Expand All @@ -22,4 +18,17 @@
splunk hard nofile 65535
splunk soft nofile 65535

- name: tell PAM to read limits
lineinfile:
path: /etc/pam.d/common-session
insertbefore: '# end of pam-auth-update config'
line: session required pam_limits.so

- name: tell PAM to read limits non-interactive
lineinfile:
path: /etc/pam.d/common-session-noninteractive
insertbefore: '# end of pam-auth-update config'
line: session required pam_limits.so
handlers:
- name: update grub
shell: /usr/sbin/update-grub