Forge Home

users

Simple Puppet module to manage users, SSH keys, and groups. Using hiera or a passed hash.

21,710 downloads

19,792 latest version

4.6 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

  • 0.1.2 (latest)
  • 0.1.1
  • 0.1.0
released Dec 1st 2016
This version is compatible with:

Start using this module

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

Add this module to your Puppetfile:

mod 'davehewy-users', '0.1.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install davehewy-users --version 0.1.2

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

davehewy/users — version 0.1.2 Dec 1st 2016

users

Table of Contents

  1. Description
  2. Setup - The basics of getting started with users
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

Simple modern port of the existing module mthibaut-users. Handles in pretty much the simplest possible way, an abstraction layer for creating users, and ssh_authorized_keys.

The module allows you to speficy users from hiera or a provided hash.

Setup

Configure your users in hiera.

common.yaml:
---
users_default:
    dhewy:
        ensure: present
        uid: 5001
        gid: users
        groups:
            - devops
        comment: Dave Heward
        managehome: true
        shell: /bin/bash
        ssh_authorized_keys:
            somedevice:
                type: 'ssh-rsa'
                key: 'somekey'

Invoke users module in site.pp manifest

site.pp:

node default{
    users{ 'users_default': }
}

Beginning with users

The very basic steps needed for a user to get the module up and running. This can include setup steps, if necessary, or it can be an example of the most basic use of the module.

Usage

Invoke users module in site.pp manifest

site.pp:

node default{
    users{ 'users_default': }
}

Using pre lookup, perhaps for local modding first.

$my_users = lookup({
    'name' => "users_all",
    'merge' => {
        'strategy' => 'hash'
    }
})

users{'my_users':
    user_hash => $my_users
}

Reference

#####user_hash Pass a user hash to the module, either pre-looked up hiera or custom hash.

Limitations/TODO

Fairly nasty .delete('ssh_authorized_keys') assumes you have an ssh_authorized_key block for each user.

Development

Contributions welcome. Open a PR if you have some ideas/feature requests.