Skip to content

Commit 50a0dbd

Browse files
committed
Do not make a hiera() call in yaml data files
1 parent 7fabc13 commit 50a0dbd

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Puppet 4.10.0 is the new minimum required version of Puppet.
1111
* Package management on apt-based systems no longer encounters dependency errors when `manage_repo => false`.
1212
* An error related to elasticsearch_roles and `yield` errors has been fixed
1313
* Correctly permit instances to be set to `absent` without errors.
14+
* Resolved an issue arising from the use of `hiera()` in Hiera yaml data files.
1415

1516
#### Features
1617

data/common.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ elasticsearch::package_provider: package
3939
elasticsearch::package_url: ~
4040
elasticsearch::pid_dir: /var/run/elasticsearch
4141
elasticsearch::pipelines: {}
42-
elasticsearch::plugindir: "%{hiera('elasticsearch::homedir')}/plugins"
42+
elasticsearch::plugindir: ~
4343
elasticsearch::plugins: {}
4444
elasticsearch::proxy_url: ~
4545
elasticsearch::purge_configdir: false

manifests/config.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
group => $elasticsearch::elasticsearch_group,
3737
owner => $elasticsearch::elasticsearch_user,
3838
mode => '0750';
39-
$elasticsearch::plugindir:
39+
$elasticsearch::_plugindir:
4040
ensure => 'directory',
4141
group => $elasticsearch::elasticsearch_group,
4242
owner => $elasticsearch::elasticsearch_user,
@@ -160,7 +160,7 @@
160160

161161
} elsif ( $elasticsearch::ensure == 'absent' ) {
162162

163-
file { $elasticsearch::plugindir:
163+
file { $elasticsearch::_plugindir:
164164
ensure => 'absent',
165165
force => true,
166166
backup => false,

manifests/init.pp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
Optional[String] $package_url,
342342
Optional[Stdlib::Absolutepath] $pid_dir,
343343
Hash $pipelines,
344-
Stdlib::Absolutepath $plugindir,
344+
Optional[Stdlib::Absolutepath] $plugindir,
345345
Hash $plugins,
346346
Optional[Stdlib::HTTPUrl] $proxy_url,
347347
Boolean $purge_configdir,
@@ -407,6 +407,13 @@
407407
default => $package_name,
408408
}
409409

410+
# Set the plugin path variable for use later in the module.
411+
if $plugindir == undef {
412+
$_plugindir = "${homedir}/plugins"
413+
} else {
414+
$_plugindir = $plugindir
415+
}
416+
410417
#### Manage actions
411418

412419
contain elasticsearch::package

manifests/package.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182

183183
exec { 'remove_plugin_dir':
184184
refreshonly => true,
185-
command => "rm -rf ${elasticsearch::plugindir}",
185+
command => "rm -rf ${elasticsearch::_plugindir}",
186186
}
187187

188188

manifests/plugin.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
}
8686
'absent': {
8787
$_file_ensure = $ensure
88-
$_file_before = File[$elasticsearch::plugindir]
88+
$_file_before = File[$elasticsearch::_plugindir]
8989
}
9090
default: { }
9191
}
@@ -134,10 +134,10 @@
134134
source => $file_source,
135135
url => $url,
136136
proxy => $_proxy,
137-
plugin_dir => $::elasticsearch::plugindir,
137+
plugin_dir => $::elasticsearch::_plugindir,
138138
plugin_path => $module_dir,
139139
}
140-
-> file { "${elasticsearch::plugindir}/${_module_dir}":
140+
-> file { "${elasticsearch::_plugindir}/${_module_dir}":
141141
ensure => $_file_ensure,
142142
mode => 'o+Xr',
143143
recurse => true,

0 commit comments

Comments
 (0)