Defined Type: kerberos::exec

Defined in:
modules/kerberos/manifests/exec.pp

Overview

Define kerberos::exec

In order to make puppet execs work with a Kerberized cluster we found out that the easiest solution is to execute a wrapper that just runs kinit before executing any command that needs authentication.

Parameters:

  • command (Any)
  • user (Any)
  • logoutput (Any) (defaults to: undef)
  • timeout (Any) (defaults to: undef)
  • unless (Any) (defaults to: undef)
  • creates (Any) (defaults to: undef)
  • refreshonly (Any) (defaults to: undef)
  • path (Any) (defaults to: undef)
  • use_kerberos (Any) (defaults to: false)


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
# File 'modules/kerberos/manifests/exec.pp', line 8

define kerberos::exec(
    $command,
    $user,
    $logoutput = undef,
    $timeout = undef,
    $unless = undef,
    $creates = undef,
    $refreshonly = undef,
    $path = undef,
    $use_kerberos = false,
) {

    require ::kerberos::wrapper

    if $use_kerberos {
        $wrapper = "${kerberos::wrapper::kerberos_run_command_script} ${user} "
    } else {
        $wrapper = ''
    }

    # 'unless' may contain a hdfs command that needs
    # authentication as well.
    if $unless and $use_kerberos {
        $unless_command = "${wrapper}${unless}"
    } else {
        $unless_command = $unless
    }

    exec { $title:
        command     => "${wrapper}${command}",
        unless      => $unless_command,
        creates     => $creates,
        refreshonly => $refreshonly,
        user        => $user,
        logoutput   => $logoutput,
        timeout     => $timeout,
        path        => $path,
    }
}