Puppet Class: centrify::adjoin::selfserve

Defined in:
manifests/adjoin/selfserve.pp

Overview

Class centrify::adjoin::selfserve

This class is called from centrify for joining AD using a computer object that has already been precreated.

Parameters:

  • domain (Any)
  • server (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
# File 'manifests/adjoin/selfserve.pp', line 6

class centrify::adjoin::selfserve (
  $domain,
  $server,
  $extra_args,
){

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

  $_opts = [
    '-w',
    '-V',
    $_server_opt,
    '--selfserve',
  ]

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

  exec { 'adjoin_with_selfserve':
    path    => '/usr/bin:/usr/sbin:/bin',
    command => $_command,
    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,
  }

}