Skip to content

Commit

Permalink
puppet-lint: autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jul 25, 2020
1 parent 6720234 commit 37de8a2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 26 deletions.
1 change: 0 additions & 1 deletion manifests/eyaml.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
$keysdir = dirname($_keysdir)

if ( $create_keys == true ) {

exec { 'createkeys':
user => $owner,
cwd => $keysdir,
Expand Down
42 changes: 19 additions & 23 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
#Deprecated
$gem_source = undef,
) inherits ::hiera::params {

if $keysdir {
$_keysdir = $keysdir
} else {
Expand Down Expand Up @@ -164,7 +163,6 @@
}

if ( $eyaml_gpg ) or ( $eyaml ) {

$eyaml_real_datadir = empty($eyaml_datadir) ? {
false => $eyaml_datadir,
true => $datadir,
Expand All @@ -176,7 +174,6 @@
} else {
$requested_backends = unique(concat(['eyaml'], $backends))
}

} else {
$requested_backends = $backends
$eyaml_real_datadir = undef
Expand Down Expand Up @@ -207,14 +204,14 @@
# the above logic. This was neccessary in order to maintain compability
# with prior versions of this module
$eyaml_options = {
'eyaml' => delete_undef_values({
'datadir' => $eyaml_real_datadir,
'extension' => $eyaml_extension,
'pkcs7_private_key' => $_eyaml_pkcs7_private_key,
'pkcs7_public_key' => $_eyaml_pkcs7_public_key,
'encrypt_method' => $encrypt_method,
'gpg_gnupghome' => $gpg_gnupghome,
'gpg_recipients' => $eyaml_gpg_recipients,
'eyaml' => delete_undef_values( {
'datadir' => $eyaml_real_datadir,
'extension' => $eyaml_extension,
'pkcs7_private_key' => $_eyaml_pkcs7_private_key,
'pkcs7_public_key' => $_eyaml_pkcs7_public_key,
'encrypt_method' => $encrypt_method,
'gpg_gnupghome' => $gpg_gnupghome,
'gpg_recipients' => $eyaml_gpg_recipients,
}),
}
$yaml_options = { 'yaml' => { 'datadir' => $datadir } }
Expand All @@ -228,7 +225,7 @@
# catch that error here and notify the user
$missing_backends = difference($backends, keys($backend_data))
if count($missing_backends) > 0 {
fail("The supplied backends: ${missing_backends} are missing from the backend_options hash:\n ${backend_options}\n
fail("The supplied backends: ${missing_backends} are missing from the backend_options hash:\n ${backend_options}\n
or you might be using symbols in your hiera data")
}

Expand All @@ -251,17 +248,16 @@
# Determine hiera version
case $hiera_version {
'5': { if ($hierarchy !~ Hiera::Hiera5_hierarchy) {
fail('`hierarchy` should be an array of hash')
}
else
{ $hiera_template = epp('hiera/hiera.yaml.epp',
{
'hiera_version' => $hiera_version,
'hiera5_defaults' => $hiera5_defaults,
'hierarchy' => $hierarchy
})
}
} # Apply epp if hiera version is 5
fail('`hierarchy` should be an array of hash')
}
else { $hiera_template = epp('hiera/hiera.yaml.epp',
{
'hiera_version' => $hiera_version,
'hiera5_defaults' => $hiera5_defaults,
'hierarchy' => $hierarchy
})
}
} # Apply epp if hiera version is 5
default: { $hiera_template = template('hiera/hiera.yaml.erb') } # Apply erb for default version 3
}
file { $hiera_yaml:
Expand Down
1 change: 0 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
$gem_source = undef,
$gem_install_options = $hiera::gem_install_options,
) {

# $gem_install_options is typically used for specifying a proxy
Package {
install_options => $gem_install_options,
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class hiera::params {
$confdir = $::settings::confdir
$hiera_version = '3'
$hiera5_defaults = {'datadir' => 'data', 'data_hash' => 'yaml_data'}
$hiera5_defaults = { 'datadir' => 'data', 'data_hash' => 'yaml_data' }
$package_ensure = 'present'
$package_name = 'hiera'
$hierarchy = []
Expand Down

0 comments on commit 37de8a2

Please sign in to comment.