Forge Home

login_defs

Manages /etc/login.defs

305,222 downloads

657 latest version

4.7 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.

Version information

  • 1.2.0 (latest)
  • 1.1.1
  • 1.1.0 (deleted)
  • 1.0.0 (deleted)
  • 0.2.0
  • 0.1.0
released Jan 31st 2024
This version is compatible with:
  • Puppet Enterprise 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • , , , , , , Gentoo, SLES

Start using this module

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

Add this module to your Puppetfile:

mod 'joshbeard-login_defs', '1.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add joshbeard-login_defs
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install joshbeard-login_defs --version 1.2.0

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

joshbeard/login_defs — version 1.2.0 Jan 31st 2024

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

Made with contributors-img.