Skip to content

joshbeard/puppet-login_defs

Repository files navigation

login_defs module for Puppet

Validation Status Codacy Badge CodeFactor Puppet Forge License

Manages /etc/login.defs on Linux systems.

Setup

What this module affects

Manages the contents, owner, group, and mode of /etc/login.defs

Beginning with this module

A regular include will use default configuration:

include login_defs

See Example Usage below for more ways to use this module.

Requirements

Usage

Class: login_defs

Parameters

mode

Specifies the file mode for /etc/login.defs. Defaults to 0644.

owner

Specifies the file owner for /etc/login.defs. Defaults to root.

group

Specifies the file group for /etc/login.defs. Defaults to 0.

options

A hash of options to populate the login.defs file with.

Reference the login.defs(5) man page for a list of configuration items and their description. http://linux.die.net/man/5/login.defs

  • Any option you add here will be merged with the default options.

  • You can override a default value here as well by using a key with the same name.

  • You can remove a default option by specifying undef or an empty string for its value.

  • Your options will not be validated for correctness.

Example Usage

To customize, set the login_defs::options parameter with values that will override and be merged with the defaults.

Specifying options in a class declaration:

class { 'login_defs':
  options => {
    'UMASK' => '022'
  }
}

In Hiera data:

login_defs::options:
  UMASK: '022'

Remove the default ENCRYPT_METHOD entirely:

class { '::login_defs':
  options => {
    'ENCRYPT_METHOD' => undef,
  },
}

Contributing

  1. Fork and clone the repository.

  2. Branch off of master.

  3. Open a merge request into master and check the validation results (GitHub Actions).

To add a distribution's default options:

  1. Create a file under data/ named as:

    - "%{facts.os.family}-%{facts.os.release.major}.yaml"
    - "%{facts.os.family}.yaml"
    - "%{facts.os.name}.yaml"

    Be specific if the options are unique to a particular release. Refer to the RedHat defaults for an example of setting common defaults in RedHat.yaml and overriding or adding parameters in RedHat-*.yml.

  2. Refer to the existing configs for an example of the structure.

  3. Set all of the default options for the distribution from /etc/login.defs without any customizations.

  4. Define a test (optional)

    Add the test to the spec/matrix.yaml file, specifying the value of the options to check. This may be duplicated from the Hiera data, but it's flat.

    A test isn't required for contributions, but it's helpful. If one isn't provided in a contribution, it will be added by the maintainer.

Contributors

Maintained by Josh Beard

See the list of contributors.