Of course, minutes after emailing that I found the answer to my own
question.

If you install the augeasproviders_grub module (
https://github.com/hercules-team/augeasproviders_grub) then it becomes as
simple as:

    kernel_parameter { 'transparent_hugepage':
      value => 'never',
      ensure => present,
    }

In CentOS7, the module is smart enough to make the change to
/etc/default/grub's GRUB_CMDLINE_LINUX variable.  From a quick look at the
code, it seems to do the right thing for other OSs too.

The Augeas people never fail to impress!

Tom

On Wed, Jul 29, 2015 at 5:30 PM, Tom Limoncelli <[email protected]> wrote:

> I need to disable transparent_hugepage at boot time (before some big
> services start up).  This is on centos7 machines using SystemD.
>
> There are many ways to do this.  It isn't clear which is the
> best/easiest way to do it via puppet.  (Here is a list of ways to do
> it manually
> http://answers.splunk.com/answers/188875/how-do-i-disable-transparent-huge-pages-thp-and-co.html
> and here is one more
> http://docs.mongodb.org/manual/tutorial/transparent-huge-pages/)
>
> The most straightforward way seems to be to edit /etc/default/grub:
>
> Change this line in /etc/default/grub and add
> transparent_hugepage=never to the GRUB_CMDLINE_LINUX.
>
> i.e.
>
> Change this line:
>
> GRUB_CMDLINE_LINUX="rd.lvm.lv=centos_ks-7/root
> rd.lvm.lv=centos_ks-7/swap crashkernel=auto
> vconsole.font=latarcyrheb-sun16 vconsole.keymap=us
> intel_pstate=disable rhgb quiet transparent_hugepage=never"
>
> to
>
> GRUB_CMDLINE_LINUX="rd.lvm.lv=centos_ks-7/root
> rd.lvm.lv=centos_ks-7/swap crashkernel=auto
> vconsole.font=latarcyrheb-sun16 vconsole.keymap=us
> intel_pstate=disable rhgb quiet transparent_hugepage=never"
>
> However doing that in puppet (even with Augeas) seems non-trivial.
>
>
>
> Any suggestions?
>
> Tom
>
> P.S.  I'm also considering making a systemd "unit" that just sets the
> parameter and is scheduled to run before any of the major services on
> the machine. However that seems like a long way to do a short thing.
>
> --
> Email: [email protected]    Work: [email protected]
> Skype: YesThatTom
> Blog:  http://EverythingSysadmin.com
>



-- 
Email: [email protected]    Work: [email protected]
Skype: YesThatTom
Blog:  http://EverythingSysadmin.com

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAHVFxgm5Okv%3DrjDhkrxcQXtEP7OAASL5E-w%2BidT5QE8qJkDhCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to