Puppet Class: centrify::adjoin::password

Defined in:
manifests/adjoin/password.pp

Overview

Class centrify::adjoin::password

This class is called from centrify for joining AD using a username and password.

Parameters:

  • join_user (Any)
  • join_password (Any)
  • domain (Any)
  • server (Any)
  • container (Any)
  • zone (Any)
  • precreate (Any)
  • extra_args (Any)


6
7
8
9
10
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'manifests/adjoin/password.pp', line 6

class centrify::adjoin::password (
  $join_user,
  $join_password,
  $domain,
  $server,
  $container,
  $zone,
  $precreate,
  $extra_args,
){

  $_server_opt = $server ? {
    undef   => '',
    default => "-s '${server}'",
  }

  $_container_opt = $container ? {
    undef   => '',
    default => "-c '${container}'",
  }

  $_zone_opt = $zone ? {
    undef   => '-w',
    default => "-z '${zone}'"
  }

  $_opts = [
    '-V',
    $_zone_opt,
    "-u '${join_user}'",
    '-p $CENTRIFY_JOIN_PASSWORD',
    $_container_opt,
    $_server_opt,
  ]

  $_join_opts = delete(concat($_opts, $extra_args), '')
  $_options   = join($_join_opts, ' ')
  $_command   = "adjoin ${_options} '${domain}'"

  if $precreate {
    exec { 'adjoin_precreate_with_password':
      path        => '/usr/bin:/usr/sbin:/bin',
      command     => "${_command} -P",
      environment => "CENTRIFY_JOIN_PASSWORD=${join_password}",
      unless      => "adinfo -d | grep ${domain}",
      before      => Exec['adjoin_with_password'],
    }
  }

  exec { 'adjoin_with_password':
    path        => '/usr/bin:/usr/sbin:/bin',
    command     => $_command,
    environment => "CENTRIFY_JOIN_PASSWORD=${join_password}",
    unless      => "adinfo -d | grep ${domain}",
    notify      => Exec['run_adflush_and_adreload'],
  }

  exec { 'run_adflush_and_adreload':
    path        => '/usr/bin:/usr/sbin:/bin',
    command     => 'adflush && adreload',
    refreshonly => true,
  }

}