Forge Home

nsswitch

Module for managing nsswitch.conf

4,770 downloads

840 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

  • 3.2.0 (latest)
  • 3.1.0
  • 3.0.0
released May 24th 2024
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

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

Add this module to your Puppetfile:

mod 'puppet-nsswitch', '3.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppet-nsswitch
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppet-nsswitch --version 3.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

puppet/nsswitch — version 3.2.0 May 24th 2024

nsswitch.conf module for Puppet

License CI Status Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

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.