From f6e229fb131031d31a8a8f3037915375435f57bc Mon Sep 17 00:00:00 2001 From: akeym Date: Mon, 30 Mar 2020 16:20:20 -0700 Subject: [PATCH 1/2] do things... better? --- configure_linux.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/configure_linux.yml b/configure_linux.yml index 46a99b2..89edce5 100644 --- a/configure_linux.yml +++ b/configure_linux.yml @@ -4,16 +4,11 @@ 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 + lineinfile: + path: /etc/default/grub + regexp: ^'GRUB_CMDLINE_LINUX_DEFAULT=' + line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash transparent_hugepage=never"' + - name: set splunk ulimit fd blockinfile: path: /etc/security/limits.d/splunk.conf @@ -22,4 +17,14 @@ 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 From eeeb45239912345a371e6da0524bb57fd8ceb1cd Mon Sep 17 00:00:00 2001 From: akeym Date: Mon, 30 Mar 2020 16:43:56 -0700 Subject: [PATCH 2/2] also update grub, fix typo --- configure_linux.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure_linux.yml b/configure_linux.yml index 89edce5..90c0fc2 100644 --- a/configure_linux.yml +++ b/configure_linux.yml @@ -3,11 +3,12 @@ user: root tasks: - - name: add script blob to disable THP on boot + - name: disable THP on boot via grub lineinfile: path: /etc/default/grub - regexp: ^'GRUB_CMDLINE_LINUX_DEFAULT=' + regexp: '^GRUB_CMDLINE_LINUX_DEFAULT=' line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash transparent_hugepage=never"' + notify: update grub - name: set splunk ulimit fd blockinfile: @@ -28,3 +29,6 @@ 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