diff --git a/README.md b/README.md index 15597a9f..e0eb474f 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,13 @@ class { 'logstash': } ``` +### Use a different logstash home +``` puppet +class { 'logstash': + home_dir => '/opt/logstash', +} +``` + ### Do not run as a service ``` puppet class { 'logstash': diff --git a/manifests/init.pp b/manifests/init.pp index 7c1e6827..9bdebe15 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -48,6 +48,9 @@ # @param [Integer] download_timeout # Timeout, in seconds, for http, https, and ftp downloads. # +# @param home_dir +# The home directory for logstash. +# # @param [String] logstash_user # The user that Logstash should run as. This also controls file ownership. # @@ -143,6 +146,7 @@ $package_url = undef, $package_name = 'logstash', Integer $download_timeout = 600, + Stdlib::Absolutepath $home_dir = '/usr/share/logstash', $logstash_user = 'logstash', $logstash_group = 'logstash', $config_dir = '/etc/logstash', @@ -154,8 +158,6 @@ Array $pipelines = [], Boolean $manage_repo = true, ) { - $home_dir = '/usr/share/logstash' - if ! ($ensure in ['present', 'absent']) { fail("\"${ensure}\" is not a valid ensure parameter value") }