Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 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
Add this module to your Puppetfile:
mod 'joshbeard-login_defs', '1.2.0'
Learn more about managing modules with a PuppetfileDocumentation
login_defs module for Puppet
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
- Requires Puppet 4.x
- Requires puppetlabs/stdlib module.
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
-
Fork and clone the repository.
-
Branch off of
master
. -
Open a merge request into
master
and check the validation results (GitHub Actions).
To add a distribution's default options:
-
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 inRedHat-*.yml
. -
Refer to the existing configs for an example of the structure.
-
Set all of the default options for the distribution from
/etc/login.defs
without any customizations. -
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.
Changelog
All notable changes to this project will be documented in this file.
Release 1.2.0
2024-01-31
- Add EL9 support, update tests/linting. @treydock PR #34)
- PDK updates, housekeeping, CI maintenance
Release 1.1.1
2022-07-21
Backwards-incompatible release that updates the code for modern language conventions.
-
0BSD license
-
Update for Puppet 4.x+ language conventions, including:
- Parameter data types
- Replace ERB template with EPP template
- Use Hiera data in module for defaults
-
Removes EL5 and EL6 from supported platforms. The default configs are still in the module - this just removes those versions from metadata.
-
Removes ancient Ubuntu releases, adds current releases.
-
Metadata syntax fix @sdwatwork PR #10
-
Modernized module with
pdk convert
-
Fixed, updated and added unit tests
Release 0.2.0
2016-04-06
- Update for EL 7 defaults (PR #1)
Dependencies
- puppetlabs/stdlib (>= 2.4.0 < 10.0.0)
The BSD Zero Clause License (0BSD) Copyright (c) 2024 Josh Beard. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.