Puppet Class: g_server::accounts

Defined in:
manifests/accounts.pp

Overview

Parameters:

  • root_password_hash (Optional[String]) (defaults to: undef)
  • root_ssh_keys (Hash) (defaults to: {})
  • root_ssh_authorized_keys (Hash) (defaults to: {})
  • admin_groups (Any) (defaults to: ['wheel'])
  • users (Hash) (defaults to: {})
  • root_selinux_role (Variant[Boolean, String]) (defaults to: 'sysadm_r')
  • root_selinux_type (Variant[Boolean, String]) (defaults to: 'sysadm_t')


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'manifests/accounts.pp', line 1

class g_server::accounts (
  Optional[String] $root_password_hash = undef,
  Hash $root_ssh_keys = {},
  Hash $root_ssh_authorized_keys = {},
  $admin_groups = ['wheel'],
  Hash $users = {},
  Variant[Boolean, String] $root_selinux_role = 'sysadm_r',
  Variant[Boolean, String] $root_selinux_type = 'sysadm_t',
){

  g_server::accounts::user { 'root':
    password_hash       => $root_password_hash,
    home                => '/root',
    shell               => '/bin/bash',
    groups              => ['root'],
    ssh_keys            => $root_ssh_keys,
    ssh_authorized_keys => $root_ssh_authorized_keys,

    admin               => false
  }

  if ($root_selinux_role == true or $root_selinux_type == true) {
    fail('Selinux role and type can be false or string.')
  }

  create_resources(g_server::accounts::user, $users)
}