account_management

pdk
Creates users/groups and installs user's shell.

Arden Puppet

arden

6,130 downloads

1,039 latest version

5.0 quality score

Version information

  • 0.3.0 (latest)
  • 0.2.2
  • 0.2.1
  • 0.1.3
  • 0.1.2
  • 0.1.1-r1
  • 0.1.1
  • 0.1.0
released Jun 17th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 < 7.0.0
  • CentOS
    ,
    RedHat
    ,
    Debian
    , Gentoo

Start using this module

Tags: accounts

Documentation

arden/account_management — version 0.3.0 Jun 17th 2020

account_management

Build Status Puppet Forge

Table of Contents

  1. Description
  2. Setup - The basics of getting started with account_management
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

Creates users/groups and installs a users preferred shell in the correct order.

Setup

What account_management affects

It creates users/groups and installs a users preferred shell. It makes sure that groups are created and preferred shells are installed before the user is created.

Usage

The example below will create a group named bridge and a user named wriker. The bridge group will be created first, then wriker's preferred shell will be installed and finally the wriker user will be created with the requested parameters.


profile::account_management::required_groups:
  bridge:
    name: 'bridge'
    gid: '1701'
profile::account_management::required_users:
  wriker:
    comment: 'beard'
    groups:
      - 'wheel'
      - 'bridge'
    uid: '1200'
    gid: '1200'
    shell: '/bin/zsh'

Cron & Exec-Once

This module also supports providing a list of cron entries and run-once executables specified on a per user basis. This can be useful if some kind of initialization is desired when a user is first created. For example, cloning a set of dotfiles from a git repository.

profile::account_management::exec_map:
  wriker:
    - command: 'chezmoi init --apply https://github.com/wriker/dotfiles.git'
      path: '/usr/local/bin:/usr/bin'
      environment: [ 'HOME=/home/wriker' ]
      creates: '/home/wriker/.local/share/chezmoi'
profile::account_management::cron_map:
  wriker:
    - command: '/usr/local/bin/chezmoi update -a'
      hour: '0'
      minute: '30'

Note that each entry in a user array provided within exec_map must include one of the following three attributes:

  • refreshonly
  • creates
  • onlyif

In the example above wriker's chezmoi configuration is installed when his user is first created. Additionally, a cron entry to refresh that configuration is scheduled to run every day at 00:30.

Limitations

OS Support

Tested on:

  • CentOS 7
  • RHEL 7
  • Gentoo
  • Debian 10

Shell Support

  • Currently only supports bash, zsh, and ksh.

Development

See the contributing guide.

Release Notes/Contributors/Etc.

Check out the contributor list