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

Add eyaml gem version param #60

Merged
merged 1 commit into from
Mar 6, 2015
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ All notable changes to this project will be documented in this file.

## [1.2.0] - 2015-03-05
### Features:
- Added `hiera::eyaml::create_keys` param to disable pkcs7 key generation with
- Added `hiera::create_keys` param to disable pkcs7 key generation with
hiera-eyaml
- Added `hiera::eyaml::gem_source` param to specify source of hiera-eyaml gem
- Added `hiera::gem_source` param to specify source of hiera-eyaml gem
- Added `hiera::eyaml_version` param to specify the version of eyaml

### Bugfixes:
- Change Modulefile to metadata.json
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ The following parameters are available for the hiera class:
* `eyaml_extension`
The file extension for the eyaml backend.
Default: `undef`, backend defaults to `'.eyaml'`
* `eyaml_version`
The version of hiera-eyaml to install. Accepts 'installed', 'latest', '2.0.7', etc
Default: `undef`
* `confdir`
The path to Puppet's confdir.
Default:
Expand Down Expand Up @@ -182,7 +185,7 @@ The following parameters are available for the hiera class:

## Limitations

The pe-puppetserver service must be restarted after hiera-eyaml is installed; this module will not do it for you.
The pe-puppetserver service must be restarted after hiera-eyaml is installed; this module will not do it for you. The `eyaml_version` parameter does not currently modify the eyaml version of the command-line gem on pe-puppetserver.

## Development

Expand Down
29 changes: 20 additions & 9 deletions manifests/eyaml.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,37 @@
# Copyright (C) 2014 Terri Haber, unless otherwise noted.
#
class hiera::eyaml (
$provider = $hiera::params::provider,
$owner = $hiera::owner,
$group = $hiera::group,
$cmdpath = $hiera::cmdpath,
$confdir = $hiera::confdir,
$create_keys = $hiera::create_keys,
$gem_source = $hiera::gem_source,
$provider = $hiera::params::provider,
$owner = $hiera::owner,
$group = $hiera::group,
$cmdpath = $hiera::cmdpath,
$confdir = $hiera::confdir,
$create_keys = $hiera::create_keys,
$eyaml_version = $hiera::eyaml_version,
$gem_source = $hiera::gem_source,
) inherits hiera::params {

$package_ensure = $eyaml_version ? {
undef => 'installed',
default => $eyaml_version,
}
package { 'hiera-eyaml':
ensure => installed,
ensure => $package_ensure,
provider => $provider,
source => $gem_source,
}
if $provider == 'pe_puppetserver_gem' {
# The puppetserver gem wouldn't install the commandline util, so we do
# that here
#XXX Pre-puppet 4.0.0 version (PUP-1073)
#BUG This can't actually update the gem version if already installed.
if $eyaml_version =~ /^\d+\.\d+\.\d+$/ {
$gem_flag = "--version ${eyaml_version}"
} else {
$gem_flag = undef
}
exec { 'install pe_gem':
command => '/opt/puppet/bin/gem install hiera-eyaml',
command => "/opt/puppet/bin/gem install hiera-eyaml ${gem_flag}",
creates => '/opt/puppet/bin/eyaml',
}
#XXX Post-puppet 4.0.0
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
$cmdpath = ['/opt/puppet/bin', '/usr/bin', '/usr/local/bin'],
$create_keys = true,
$gem_source = undef,
$eyaml_version = undef,
$merge_behavior = undef,
$extra_config = '',
) inherits hiera::params {
Expand Down