Skip to content
Snippets Groups Projects
Commit 4f3c649d authored by Karl Kornel's avatar Karl Kornel
Browse files

wallet: Test for running in a builder environment

parent 74b07b83
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,15 @@ ...@@ -31,6 +31,15 @@
# path => '/etc/foobar/password', # path => '/etc/foobar/password',
# type => 'file', # type => 'file',
# } # }
#
# It is important to note that, by default, this code will use the host's
# keytab (located at /etc/krb5.keytab), so you will need to have that in
# place before your Puppet code runs. Or, you can pass a keytab file path
# using the $auth_keytab variable.
#
# Also, if base::wallet detects that it is being run under Packer, then
# it will not do anything. If you want it to run under Packer, then set
# $build_ok to true, and also set $auth_keytab appropriately.
# These helper routines are broken out separately to reduce indentation, but # These helper routines are broken out separately to reduce indentation, but
# shouldn't be called separately. They're purely an implementation detail. # shouldn't be called separately. They're purely an implementation detail.
...@@ -46,6 +55,7 @@ define base::wallet( ...@@ -46,6 +55,7 @@ define base::wallet(
$type = 'keytab', $type = 'keytab',
$onlyif = 'NONE', $onlyif = 'NONE',
$heimdal = false, $heimdal = false,
$build_ok = false,
$path $path
) { ) {
case $auth_principal { case $auth_principal {
...@@ -62,27 +72,29 @@ define base::wallet( ...@@ -62,27 +72,29 @@ define base::wallet(
file { $path: ensure => absent } file { $path: ensure => absent }
} }
'present': { 'present': {
case $type { if ($build_ok or !$::packer_build_name) {
'keytab': { case $type {
base::wallet::keytab { $name: 'keytab': {
kstart_cmd => $kstart_cmd, base::wallet::keytab { $name:
path => $path, kstart_cmd => $kstart_cmd,
primary => $primary, path => $path,
mode => $mode, primary => $primary,
owner => $owner, mode => $mode,
group => $group, owner => $owner,
heimdal => $heimdal, group => $group,
heimdal => $heimdal,
}
} }
} default: {
default: { base::wallet::other { $name:
base::wallet::other { $name: kstart_cmd => $kstart_cmd,
kstart_cmd => $kstart_cmd, path => $path,
path => $path, type => $type,
type => $type, mode => $mode,
mode => $mode, owner => $owner,
owner => $owner, group => $group,
group => $group, onlyif => $onlyif,
onlyif => $onlyif, }
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment