Puppet Class: psick::users::ad

Defined in:
manifests/users/ad.pp

Overview

Class psick::users::ad This class uses trlinkin/domain_membership for domain join on Windows

Examples:

Hiera configuration example

psick::users::ad::domain: 'my.ads.domain'
psick::users::ad::username: 'Domain Administrator'
psick::users::ad::password: 'secret'
psick::users::ad::create_machine_account: true
psick::users::ad::machine_ou: '$null'

Parameters:

  • domain (Array)
  • username (String)
  • password (String)
  • machine_ou (String)
  • create_machine_account (Boolean) (defaults to: true)
  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'manifests/users/ad.pp', line 11

class psick::users::ad (
  Array $domain,
  String $username,
  String $password,
  String $machine_ou,
  Boolean $create_machine_account = true,

  Boolean $manage      = $psick::manage,
  Boolean $noop_manage = $psick::noop_manage,
  Boolean $noop_value  = $psick::noop_value,
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }
    if $facts['kernel'] == 'Linux' {
      class { 'sssd':
        domains => $domain,
      }
    }
    if $facts['kernel'] == 'Windows' {
      $join_options = $create_machine_account ? {
        true  => '3',
        false => '1',
      }

      class { 'domain_membership':
        domain       => $domain,
        username     => $username,
        password     => $password,
        resetpw      => false,
        machine_ou   => $machine_ou,
        join_options => $join_options,
      }
    }
  }
}