Forge Home

accounts

Simple module to manage groups and users

7,997 downloads

6,669 latest version

4.3 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

  • 1.0.2 (latest)
  • 1.0.1
released Nov 28th 2016
This version is compatible with:
  • Puppet Enterprise >=2016.1.2
  • Puppet >=4.4.0 <5.0.0
  • Redhat, Ubuntu, Debian, CentOS

Start using this module

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

Add this module to your Puppetfile:

mod 'rberwald-accounts', '1.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add rberwald-accounts
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install rberwald-accounts --version 1.0.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

rberwald/accounts — version 1.0.2 Nov 28th 2016

#accounts

####Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with accounts
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Testing - Ensure quality for PRs, etc.
  8. Dependencies - Modules required to run

##Overview

The accounts module configures groups and users.

##Module Description

The accounts module configures groups and users taken from Hiera, or given as a parameter. The module uses the Data in Module features added in puppet 4.4 (PE 2016.1) to set defaults instead of using a params.pp file.

##Setup

###Beginning with accounts

Follow this page to setup your puppet server for data in modules.

Depending on how your setup is, you can now use:

include '::accounts'

from anywhere.

class { '::accounts':
  users => { ... },
}

from profile and roles.

Or add the class 'accounts' to you 'classes' array, if you use

hiera_include('classes')

Specifying users will be done in hiera. An example:

accounts::users:
  test1:
    ensure          : 'present'
    comment         : 'Example user
    gid             : '1000'
    groups          : ['test1']
    home            : '/home/test1'
    password        : '$6$evMMbifxTtJDKNy/mil740khsd7298fedsdcUcWNHaZtbVD.axWh0ZLN28M0'
    uid             : '1000'
    ssh_key:
      key1:
        type: 'ssh-rsa'
        key: 'AAAAFakeKeyDataXYZ=='

This will create an user 'test1' with a password.

##Usage

All interaction with the accounts module can be done through the main accounts class. This means you can simply toggle the options in ::accounts to have full functionality of the module.

##Reference

###Classes

####Public Classes

  • accounts: Main class, includes all other classes.

####Private Classes

  • accounts::manage_groups: Handles the packages.
  • accounts::manage_users: Handles the configuration file.

###Parameters

The following parameters are available in the ::accounts class:

####users

Hash with the users to be managed. Default value: '{}' (empty hash)

####groups

Hash with the groups to be managed. Default value: '{}' (empty hash)

####purge_users

Specifies if unmanaged users should be purged from the system. Default value: 'false'

####protect_system_users

Specifies if system users should be protected from purging from the system. Default value: 'false'

####purge_groups

Specifies if unmanaged groups should be purged from the system. Default value: 'false'

####signal_purge_only

Specifies if purging of users and groups should be 'noop' operations. Default value: 'false'

####user_defaults

Default settings for all managed users. Default value:

accounts::user_defaults:
  allowdupe        : false
  managehome       : true
  purge_ssh_keys   : true
  shell            : '/bin/bash'
  password_max_age : '99999'
  password_min_age : '0'

####group_defaults

Default settings for all managed groups. Default value:

accounts::group_defaults:
  allowdupe : false

##Limitations

This module has should work on Posix all PE-supported platforms, since it only calls the group and user resource, but has been tested only on RedHat and Ubuntu.

##Testing

Run rspec to double check tests pass.

##Dependencies

The following modules are required:

  • puppetlabs-stdlib