Forge Home

cgroups

manage cgroups functionality

10,214 downloads

7,630 latest version

4.3 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 2.1.1 (latest)
  • 2.1.0
  • 2.0.1
  • 2.0.0 (deleted)
  • 1.0.1
  • 1.0.0
released Feb 20th 2017
This version is compatible with:
  • Puppet Enterprise >= 3.2.0 < 5.0.0
  • Puppet >= 3.0.0 < 5.0.0
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'ericsson-cgroups', '2.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ericsson-cgroups
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ericsson-cgroups --version 2.1.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

ericsson/cgroups — version 2.1.1 Feb 20th 2017

puppet-module-cgroups

Manage cgroups configuration service and files.

  • /etc/cgconfig.conf
  • /etc/cgconfig.d/*.conf

Compatibility

This module has been tested to work on the following systems with Puppet v3 (with and without the future parser) and Puppet v4 (with strict variables) using Ruby versions 1.8.7 (Puppet v3 only), 1.9.3, 2.0.0, 2.1.0 and 2.3.1.

  • EL 6
  • EL 7
  • SLED 11 SP2
  • SLES 11 SP2

Build Status

Class cgroups

Description

The cgroups class is used to configure the cgroup service and its main configuration details.

Parameters


cgconfig_content (string)

Optional, specify arbitary content for the cgconfig.conf file that will be included at the bottom.

  • Default: undef

config_file_path (string)

Absolute path to cgroups config file.

  • Default: '/etc/cgconfig.conf'

groups (hash)

A hash containing group resources to be configured (see below for cgroups::group resources)

  • Default: undef
Example:
cgroups::groups:
  "user/mgw-all":
    permissions:
      task:
        uid: root
        gid: mgw-all
      admin:
        uid: root
        gid: mgw-all
    controllers:
      cpuset:
        "cpuset.mems": "0"
        "cpuset.cpus": "0,1"
Hiera example with Suse 11.2 bugfix:
cgroups::user_path_fix: '/sys/fs/cgroup/user/mgw-all'
cgroups::groups:
  "user/mgw-all":
    permissions:
      task:
        uid: root
        gid: mgw-all
      admin:
        uid: root
        gid: mgw-all
    controllers:
      cpuset:
        "cpuset.mems": "0"
        "cpuset.cpus": "0,1"

mounts (hash)

A hash containing mounts to be configured in /etc/cgconfig.conf. NOTE: On systemd managed systems, the default resource controllers are the domain of systemd, therefore this setting should probably not be used unless you are managing a controller not yet supported by systemd such as net_prio.

  • Default: undef
Example:
cgroups::mounts:
  cpu: '/cgroup'

package_name (string or array)

Name of package(s) that enables cgroups. Only set it to overwrite the modules defaults: RedHat 'libcgroup', Suse 'libcgroup1'.

  • Default: undef

service_name (string)

Name of service to manage.

  • Default: 'cgconfig'

user_path_fix (string)

Absolute path to set 0775 permissions on when defined. This is a fix for Suse that have a bug in setting this though the config file. Only available on Suse.

  • Default: undef

Defined type cgroups::group

Description

The cgroups::group definition is used to configure cgroup entries in /etc/cgconfig.d.

You can also specify cgroups::groups from hiera as a hash of group resources and they will be created by the base class using create_resources.

Parameters


controllers (hash)

An optional hash containing the controllers for the group.

  • Default: undef
Example:
  controllers => {
    'cpuset' => { 
      'cpuset.mems' => '0',
      'cpuset.cpus' => '0,1'
    }
  }

permissions (hash)

An optional hash containing permissions for the group.

  • Default: undef
Example:
  permissions => {
    'task' => {
      'uid' => 'root',
      'gid' => 'mgw-all',
    },
    'admin' => {
      'uid' => 'root',
      'gid' => 'mgw-all',
    },
  }

target_path (string)

Optional parameter to define in which path the configuration file should be put. By default the module will use the /etc/cgconfig.d directory.

  • Default: '/etc/cgconfig.d'

Full example

cggroups::group { 'mgw/user':
  permissions => {
    'task' => {
      'uid' => 'root',
      'gid' => 'mgw-all',
    },
    'admin' => {
      'uid' => 'root',
      'gid' => 'mgw-all',
    },
  },
  controllers => {
    'cpuset' => { 
      'cpuset.mems' => '0',
      'cpuset.cpus' => '0,1'
    }
  }
}