Git Product home page Git Product logo

puppet-tuned's Introduction

puppet-tuned

Overview

Install, enable and configure the tuned adaptive system tuning daemon found in Red Hat Enterprise Linux.

  • tuned : Class to install and enable tuned

Examples

Install and enable tuned with the ''default'' profile :

include '::tuned'

Install and enable tuned with the ''virtual-host'' profile :

class { '::tuned': profile => 'virtual-host' }

Check the output of tuned-adm list to see the available profiles on your systems.

Install and enable tuned with a custom profile, contained in another module :

class { '::tuned':
  profile => 'my-super-tweaks',
  source  => 'puppet:///modules/mymodule/tuned-profiles/my-super-tweaks',
}

The above expects modules/mymodule/files/tuned-profiles/my-super-tweaks/tuned.conf and may include additional scripts next to tuned.conf.

Install and enable tuned with a custom profile :

class { '::tuned':
  profile  => 'my-super-tweaks',
  settings => {
    'main'   => {
      'include' => 'virtual-guest',
    },
    'sysctl' => {
      'vm.dirty_ratio' => '30',
      'vm.swappiness'  => '30',
    },
  },
}

To completely stop, disable and remove tuned :

class { '::tuned': ensure => 'absent' }

puppet-tuned's People

Contributors

mlehner616 avatar olifre avatar osgpcq avatar thias avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

puppet-tuned's Issues

tuned-adm profile exec resource has incorrect PATH

I'm not exactly sure what happened here, but this seemed to have suddenly stopped working as expected.

I did some debugging by adding logoutput => true to tuned-adm profile exec resource and found that when the command is executed the subcommands /sbin/service and /sbin/chkconfig fail to run with command not found because the path set for the exec resource is missing /sbin.

Brace yourself, a PR is coming.

ktune.service failed to load: No such file or directory

==> db: Error: Could not start Service[ktune]: Execution of '/bin/systemctl start ktune' returned 6: Failed to issue method call: Unit ktune.service failed to load: No such file or directory.
==> db: Error: /Stage[main]/Tuned/Service[ktune]/ensure: change from stopped to running failed: Could not start Service[ktune]: Execution of '/bin/systemctl start ktune' returned 6: Failed to issue method call: Unit ktune.service failed to load: No such file or directory.
[root@db ~]# facter -p | grep operatingsystem
operatingsystem => CentOS
operatingsystemmajrelease => 7
operatingsystemrelease => 7.1.1503

Scripts in Custom Profiles are not Executable

Hi

In order for scripts in custom profiles to work, they must be executable. However, init.pp specifies a mode of 0644 for files in the profile file tree. This means the script isn't executed when the custom profile is made active, and thus it doesn't work as intended.

A quick fix is to change line 57 in init.pp from

mode => '0644'

to

mode => '0744'

Should fail gracefully on unsupported OS's

Greetings,
I appreciate your module quite a bit and I am currently using it on several of my systems. I did run into a small problem. After successfully testing your module on a select few test systems, I decided to push it out to a larger test set. I forgot that I had a mix of CentOS 5 and 6 servers in that test batch and thus puppet kicked back several errors on this module. It would be nice if the module would fail gracefully with a single message. Maybe something like this (I yanked it from the puppet documentation):
fail("Module ${module_name} is not supported on ${::operatingsystem}")

I started to write a check to verify that the OSFamily is either Fedora (version 12+) or RedHat (version 6+) but I thought I would see if you had a preference on how the check was written before I got too far along. I was considering a if else statement on osfamily (RedHat | default) with a case statement for (Fedora | RedHat/Scientific/CentOS/OracleLinux | default) to check for version compatibility. The default would just print out the error message. I don't see why the first if statement check couldn't also be wrapped up in the current ensure check either; it would keep the nesting to a minimal.

I don't mind coding it up, testing it, and pushing it up to you. I just figured I would get your thoughts on it first.

Thanks!

ensure_package from stdlib?

On the one hand I love that this module has no dependencies, on the other, I've got package defs coming in from a few locations. Can the package{} be converted to ensure_package from stdlib?

Modifications to tuned profile should trigger a refresh

Unsure how exactly this is best handled with tuned. If a profile is modified, should that File resource notify the tuned service to restart?

Happy to submit PR just unsure best way to handle changes to a tuned profile.

custom profile is broken with tuned-2.5.1

following the example I provide a custom profile in puppet like

class { '::tuned':
  profile => 'my-super-tweaks',
  source  => 'puppet:///modules/mymodule/tune-profiles/my-super-tweaks',
}

This results in a file created at /etc/tuned/ called my-super-tweaks. This is not recognized by tuned as a valid profile.

The tool expects instead a folder in /etc/tuned with the profile name and a file called tuned.conf inside with the profile tweaks. eg. /etc/tuned/my-super-tweaks/tuned.conf

Documentation here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.