Forge Home

accounts

Puppet module for Managing SSH keys, users and groups

675,404 downloads

505 latest version

5.0 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

  • 2.1.1 (latest)
  • 2.1.0
  • 1.11.1
  • 1.11.0
  • 1.10.0
  • 1.9.3
  • 1.9.0
  • 1.8.0
  • 1.7.0
  • 1.6.0
  • 1.5.1
  • 1.5.0
  • 1.4.0
  • 1.3.5
  • 1.3.4
  • 1.3.3
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1.1.11
  • 1.1.10
  • 1.1.9
  • 1.1.8
  • 1.1.7
  • 1.1.6
  • 1.1.5
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.2
  • 1.0.1
  • 0.1.0
released Nov 15th 2023
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, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
  • Puppet >= 6.0.0 < 9.0.0
  • , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'camptocamp-accounts', '2.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install camptocamp-accounts --version 2.1.1

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

camptocamp/accounts — version 2.1.1 Nov 15th 2023

Accounts

Puppet Forge Version Puppet Forge Downloads Build Status Gemnasium By Camptocamp

Usage

First, you have to declare your ssh_keys, users and usergroups hashes:

class { 'accounts':
  ssh_keys   => lookup('accounts::ssh_keys', Hash, 'hash', {}),
  users      => lookup('accounts::users', Hash, 'hash', {}),
  usergroups => lookup('accounts::usergroups', 'Hash, 'hash', {}),
}

Example hiera YAML file:

---
accounts::ssh_keys:
  foo:
    type: ssh-rsa
    public: FOO-S-RSA-PUBLIC-KEY
  bar:
    type: ssh-rsa
    public: BAR-S-RSA-PUBLIC-KEY

accounts::users:
  foo:
    uid: 1000
    comment: Foo
  bar:
    uid: 1001
    comment: Bar
  baz:
    # Remove user baz from every node (unless overridden)
    ensure: absent
  qux:
    uid: 1003
    comment: Qux

accounts::usergroups:
  foo:
    - foo
    - bar
  bar:
    - baz
    - qux

Then you can create accounts on your node with the accounts::account defined type.

accounts::account { 'foo': }

Creates a foo user if it exists in $::accounts::users and at allow its public key if it exists in $::accounts::ssh_keys.

accounts::account { 'bar':
  authorized_keys => ['@foo', 'baz'],
}

Creates a bar user if it exists in $::accounts::users and at allow its public key, everyone's in thefoo usergroup's public key and baz's one if it exists in $::accounts::ssh_keys.

accounts::account { '@foo': }

Create a user for every user in foo usergroup and allow its public key.

Module Parameters

groups

Hash of groups to create (passed to create_resources). Defaults to {}.

groups_membership

Default value for the users' membership parameter. Refer to the Puppet documentation for more information.

ssh_keys

Hash of SSH public keys that can be assigned to users (see Usage above).

users

Hash of users (see Usage above).

usergroups

Hash of user groups (see Usage above).

accounts

Hash of accounts to create (see Usage above).

forcelocal

Set the resource "user" parameter so that the users are not created/supressed in external user directories (i.e. LDAP).

start_uid

Sets the lowest uid for non system users. This is a system setting and also affects users created outside of this module.

start_gid

Sets the lowest gid for non system groups. This is a system setting and also affects groups or users created outside of this module.

purge_ssh_keys

Default value for users' purge_ssh_keys parameter. When true all SSH keys in a users authorized_keys file not managed by Puppet will be deleted. Defaults to false.

shell

Default value for users' shell parameter. Default is the system default (usually /bin/sh).