Forge Home

login_defs

Manage login.defs

3,549 downloads

204 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

  • 2.0.0 (latest)
  • 1.1.0
  • 1.0.0
  • 0.2.0
  • 0.1.0
released Jan 20th 2024
This version is compatible with:
  • Puppet Enterprise 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 < 8.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.0.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.0.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.0.0 Jan 20th 2024

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,
}