Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug in the latest push from PR #102, that doesn't use the _keysdir path when creating keys #110

Merged
merged 4 commits into from
Jan 27, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ The following parameters are available for the hiera class:
This is useful for configuring backend-specific parameters.
Default: `''`
* `keysdir`
Directory for hiera to manage for eyaml keys.
Directory for hiera to manage for eyaml keys. This is the path where /keys should be managed not the full path to the /keys directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smbambling I was also thinking that the hiera::keysdir parameter would be the full path to keys/, like keysdir => /etc/puppet/eyaml_keys or whatever. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be...

where it bites you as you would need to munge that into a new variable to use with

exec { 'createkeys':
        user    => $owner,              user    => $owner,
        cwd     => $confdir,         +      cwd     => $keysdir,

I was also trying to keep with the pattern used for _keysdir in init.pp

Default: `$confdir/keys`
* `puppet_conf_manage`
Whether to manage the puppet.conf `hiera_config` value or not.
Expand Down
11 changes: 6 additions & 5 deletions manifests/eyaml.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$cmdpath = $hiera::cmdpath
$confdir = $hiera::confdir
$create_keys = $hiera::create_keys
$keysdir = $hiera::keysdir
$_keysdir = $hiera::_keysdir
$eyaml_version = $hiera::eyaml_version
$gem_source = $hiera::gem_source
Expand Down Expand Up @@ -103,20 +104,20 @@
if ( $create_keys == true ) {
exec { 'createkeys':
user => $owner,
cwd => $confdir,
cwd => $keysdir,
command => 'eyaml createkeys',
path => $cmdpath,
creates => "${confdir}/keys/private_key.pkcs7.pem",
require => [ $hiera_package_depedencies, File["${confdir}/keys"] ],
creates => "${_keysdir}/private_key.pkcs7.pem",
require => [ $hiera_package_depedencies, File[$_keysdir] ],
}

file { "${confdir}/keys/private_key.pkcs7.pem":
file { "${_keysdir}/private_key.pkcs7.pem":
ensure => file,
mode => '0600',
require => Exec['createkeys'],
}

file { "${confdir}/keys/public_key.pkcs7.pem":
file { "${_keysdir}/public_key.pkcs7.pem":
ensure => file,
mode => '0644',
require => Exec['createkeys'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
$master_service = $hiera::params::master_service,
) inherits hiera::params {
if $keysdir {
$_keysdir = $keysdir
$_keysdir = "${keysdir}/keys"
} else {
$_keysdir = "${confdir}/keys"
}
Expand Down