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

Make elasticsearch usable with older version #364

Merged
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
1 change: 1 addition & 0 deletions data/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ prometheus::elasticsearch_exporter::package_ensure: 'latest'
prometheus::elasticsearch_exporter::package_name: 'elasticsearch_exporter'
prometheus::elasticsearch_exporter::user: 'elasticsearch-exporter'
prometheus::elasticsearch_exporter::version: '1.1.0rc1'
prometheus::elasticsearch_exporter::use_kingpin: true
prometheus::extra_groups: []
prometheus::global_config:
'scrape_interval': '15s'
Expand Down
13 changes: 12 additions & 1 deletion manifests/elasticsearch_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
#
# [*version*]
# The binary release version
#
# [*use_kingpin*]
# Since version 1.1.0, the elasticsearch exporter uses kingpin, thus
# this param to define how we call the es.uri and es.timeout in the $options
# https://github.com/justwatchcom/elasticsearch_exporter/blob/v1.1.0/CHANGELOG.md

class prometheus::elasticsearch_exporter (
String $cnf_uri,
Expand All @@ -89,6 +94,7 @@
String $package_name,
String $user,
String $version,
Boolean $use_kingpin,
Boolean $purge_config_dir = true,
Boolean $restart_on_change = true,
Boolean $service_enable = true,
Expand Down Expand Up @@ -116,7 +122,12 @@
default => undef,
}

$options = "--es.uri=${cnf_uri} --es.timeout=${cnf_timeout} ${extra_options}"
$flag_prefix = $use_kingpin ? {
true => '--',
false => '-',
}

$options = "${flag_prefix}es.uri=${cnf_uri} ${flag_prefix}es.timeout=${cnf_timeout} ${extra_options}"

prometheus::daemon { 'elasticsearch_exporter':
install_method => $install_method,
Expand Down