Forge Home

users

Manage users using hiera data.

86,710 downloads

80,475 latest version

1.9 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.0.11 (latest)
  • 1.0.10
  • 1.0.9
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Jul 18th 2013

Start using this module

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

Add this module to your Puppetfile:

mod 'mthibaut-users', '1.0.11'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add mthibaut-users
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install mthibaut-users --version 1.0.11

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
Tags: users, user, hiera

Documentation

mthibaut/users — version 1.0.11 Jul 18th 2013

users

Build Status

Overview

The users module allows management of user accounts through hiera or a hash of directly specified users.

Module Description

Normally each user needs to be specified inside a puppet manifest. This module allows you to specify the users outside of puppet, so that the user setup can become variable.

Setup

Configure your users in hiera

    common.yaml:

    ---
    users_sysadmins:
        john:
            ensure: present
            uid: 1000
            gid: staff
            groups: - wheel
            comment: John Doe
            managehome: true
            ssh_authorized_keys:
                    mykey:
                            type: 'ssh-rsa'
                            key:  'mykeydata=='

All parameters to the standard types 'user' and 'ssh_authorized_key' can be used.

Include users in your manifest

    site.pp:

    node /default/ {
        users { sysadmins: }
    }

Usage

The name given to the users type will be used to lookup 'users_$name' inside hiera. Alternatively you can specify the hash directly without hiera, see below.

The defined type users can be called with two arguments:

###match

Defaults to 'all'. Can be 'all', 'any' (sysonym for 'all'), or 'first'.

If 'first' is used, then only the first match in your hiera hierarchy will be used. If you specify 'all' then all matching hashes will be be used. This corresponds directly to the respective 'hiera' and 'hiera_hash' function calls.

###hash

Defaults to undef. Uses the given hash rather than the result of the hiera lookup.

Troubleshooting

Before blaming me, check if your hiera configuration is working correctly. For instance, you can use this to check if puppet is seeing your hiera data correctly:

    node /mynode/ {
            $mytest = hiera("users_sysadmins", "not found")
            notify { "$mytest": }
    }

Dependencies

  • In puppet 3.0.0, hiera became a standard function call so it is included by default in your puppet installation. Before 3.0.0, you must install the hiera-puppet module.

  • stdlib