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
- SLES, , Gentoo, , Archlinux , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-nsswitch', '3.2.0'
Learn more about managing modules with a PuppetfileDocumentation
nsswitch.conf module for Puppet
A way of expressing nsswitch.conf configurations declaratively.
Defaults
Currently this module has support for EL based Linux distributions, Fedora, Debian/Ubuntu, and Gentoo. This module by default will create a basic nsswitch.conf that uses defaults derived from what the distribution uses in the nsswitch.conf file on fresh install. These defaults have been verified on the mentioned distributions by the kindness and diligence of contributors, of which I'm very grateful.
Usage
See REFERENCE.md for full API details.
nsswitch class
This is the class by which you will manage the nsswitch.conf file. There is one parameter per standard database NSS supports. The class accepts both strings and arrays as parameters. The benefit being, you could possibly merge an array of options with hiera. When using an array, each element should be the lookup service followed by the reaction statement.
Available parameters are:
- passwd
- group
- shadow
- hosts
- bootparams
- aliases
- automount
- ethers
- netgroup
- netmasks
- network
- protocols
- publickey
- rpc
- services
- shells
- sudo
For more information on NSS, please see the man pages. man 5 nsswitch.conf
Examples
# defaults only
include nsswitch
# setting a simple lookup
class { 'nsswitch':
publickey => 'nis',
}
# 'hosts' lookups contain a reaction statement for the 'dns' service
class { 'nsswitch':
passwd => ['ldap','files'],
hosts => ['dns [!UNAVAIL=return]','files'],
}
Example nsswitch.conf with all defaults for RHEL systems
# This file is controlled by Puppet
passwd: files
shadow: files
group: files
hosts: files dns
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files
netgroup: nisplus
publickey: nisplus
automount: files nisplus
aliases: files nisplus
Authors and Module History
Puppet-nsswitch has been maintained by VoxPupuli since version 3.0.0. It was migrated from https://forge.puppet.com/modules/trlinkin/nsswitch. It is licensed under the Apache-2 license.
Reference
Table of Contents
Classes
nsswitch
: Manages the system nsswitch.conf configuration
Classes
nsswitch
This module creates a nsswitch.conf
file with all the lines that determine
the sources from which to obtain name-service information in a range of
categories, and in what order.
- See also
- nsswitch.conf(5)
Examples
Basic example
include nsswitch
class { 'nsswitch':
passwd => ['ldap','files'],
hosts => ['dns [!UNAVAIL=return]','files'],
}
Parameters
The following parameters are available in the nsswitch
class:
aliases
automount
bootparams
ethers
group
gshadow
hosts
netgroup
netmasks
networks
passwd
protocols
publickey
rpc
services
shadow
shells
sudoers
subid
file_path
file_group
file_owner
file_perms
aliases
Data type: Optional[Variant[String[1], Array[String[1]]]]
Mail aliases, used by getaliasent() and related functions.
Default value: undef
automount
Data type: Optional[Variant[String[1], Array[String[1]]]]
Which conventions to use for automounting of homes.
Default value: undef
bootparams
Data type: Optional[Variant[String[1], Array[String[1]]]]
Where bootparams shall be supplied from (e.g. for diskless clients at boot time using rpc.bootparamd).
Default value: undef
ethers
Data type: Optional[Variant[String[1], Array[String[1]]]]
Ethernet numbers.
Default value: undef
group
Data type: Optional[Variant[String[1], Array[String[1]]]]
Groups of users, used by getgrent() and related functions.
Default value: undef
gshadow
Data type: Optional[Variant[String[1], Array[String[1]]]]
Shadow groups, used by getspnam() and related functions.
Default value: undef
hosts
Data type: Optional[Variant[String[1], Array[String[1]]]]
Host names and numbers, used by gethostbyname() and related functions.
Default value: undef
netgroup
Data type: Optional[Variant[String[1], Array[String[1]]]]
Network-wide list of hosts and users, used for access rules.
Default value: undef
netmasks
Data type: Optional[Variant[String[1], Array[String[1]]]]
Netmasks specify how much of the address to reserve for sub-dividing networks into subnetworks.
Default value: undef
networks
Data type: Optional[Variant[String[1], Array[String[1]]]]
Network names and numbers, used by getnetent() and related functions.
Default value: undef
passwd
Data type: Optional[Variant[String[1], Array[String[1]]]]
User passwords, used by getpwent() and related functions.
Default value: undef
protocols
Data type: Optional[Variant[String[1], Array[String[1]]]]
Network protocols, used by getprotoent() and related functions.
Default value: undef
publickey
Data type: Optional[Variant[String[1], Array[String[1]]]]
Public and secret keys for Secure_RPC used by NFS and NIS+.
Default value: undef
rpc
Data type: Optional[Variant[String[1], Array[String[1]]]]
Remote procedure call names and numbers, used by getrpcbyname() and related functions.
Default value: undef
services
Data type: Optional[Variant[String[1], Array[String[1]]]]
Network services, used by getservent() and related functions.
Default value: undef
shadow
Data type: Optional[Variant[String[1], Array[String[1]]]]
Shadow user passwords, used by getspnam() and related functions.
Default value: undef
shells
Data type: Optional[Variant[String[1], Array[String[1]]]]
Valid user shells, used by getusershell() and related functions.
Default value: undef
sudoers
Data type: Optional[Variant[String[1], Array[String[1]]]]
Sudoers policy module users.
Default value: undef
subid
Data type: Optional[Variant[String[1], Array[String[1]]]]
subuid and subgid mapping
Default value: undef
file_path
Data type: Stdlib::Unixpath
The path to nsswitch.conf
on the system.
Default value: '/etc/nsswitch.conf'
file_group
Data type: String[1]
Group of the nsswitch.conf file
Default value: 'root'
file_owner
Data type: String[1]
Owner of the nsswitch.conf file
Default value: 'root'
file_perms
Data type: Stdlib::Filemode
Permissions for the nsswitch.conf file
Default value: '0644'
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v3.2.0 (2024-05-24)
Implemented enhancements:
v3.1.0 (2024-02-06)
Implemented enhancements:
- Add Ubuntu 22.04 support #10 (threepistons)
v3.0.0 (2023-12-05)
Breaking changes:
- Drop EOL operating systems #5 (treydock)
- Rebrand module to Vox Pupuli organization #4 (treydock)
- Require at least Puppet 7 #3 (treydock)
Implemented enhancements:
- Replace params class with Hiera data for default values #7 (treydock)
- Support Puppet 8 #2 (treydock)
Fixed bugs:
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 4.25.0 < 10.0.0)