login_defs

Manage login.defs

3,775 downloads

42 latest version

Version information

  • 2.1.0 (latest)
  • 2.0.0
  • 1.1.0
  • 1.0.0
  • 0.2.0
  • 0.1.0
released Apr 27th 2025
This version is compatible with:
  • Puppet Enterprise 2025.2.x, 2025.1.x, 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x
  • Puppet >= 8.0.0 < 9.0.0
  • , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'genv-login_defs', '2.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install genv-login_defs --version 2.1.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

genv/login_defs — version 2.1.0 Apr 27th 2025

login_defs

Build Status Release Puppet Forge Apache-2 License

Configure and manage the /etc/login.defs file that defines site-specific configuration for the shadow password suite.

Usage

Including login_defs will manage /etc/login.defs with the default configuration supplied by supported distributions:

include login_defs

To manage the file permissions:

class { 'login_defs':
  owner => 0,
  group => 0,
  mode  => '0644',
}

Configuration Examples

The options parameter accepts a hash of value, comment and enabled.

  • When enabled is false the setting will be commented out.
  • The comment parameter is used to maintain comments in the file.

Manifest Example

# Manifest example
class { 'login_defs':
  mode    => '0644',
  options => {
    'PASS_MAX_DAYS' => {
      value   => 30,
      comment => 'Maximum number of days a password may be used.',
    },
    'DEFAULT_HOME' => {
      value   => 'yes',
      enabled => false,
    }
  }
}

Hiera Example

login_defs::mode: '0644'
login_defs::options:
  PASS_MAX_DAYS:
    value: 30
    comment: Maximum number of days a password may be used.

  DEFAULT_HOME:
    value: 'yes'
    enabled: false

  TTYGROUP:
    value: tty
    comment: |-
      If you have a "write" program which is "setgid" to a special group
      which owns the terminals, define TTYGROUP to the group number and
      TTYPERM to 0620.  Otherwise leave TTYGROUP commented out and assign
      TTYPERM to either 622 or 600.
  TTYPERM:
    value: '0600'

Managing the Package

This module will not, by default, manage the login (Debian) or shadow-utils (RedHat) package. This can be enabled and customised with:

class { 'login_defs':
  package_manage => true,
  package_ensure => 'installed',
  package_name   => undef,
}