Skip to content
Browse files

parameterizing elasticsearch url

  • Loading branch information...
1 parent b1f9159 commit fcb82a62cc528bcc5033ca1d95fd719df0384e23 Dave Pippenger committed Dec 11, 2013
Showing with 12 additions and 7 deletions.
  1. +0 −4 files/elastic.yaml
  2. +8 −3 manifests/integrations/elasticsearch.pp
  3. +4 −0 templates/elastic.yaml.erb
View
4 files/elastic.yaml
@@ -1,4 +0,0 @@
-init_config:
-
-instances:
- - url: http://localhost:9200
View
11 manifests/integrations/elasticsearch.pp
@@ -1,22 +1,27 @@
# Class: datadog::integrations::elasticsearch
#
# This class will install the necessary configuration for the elasticsearch integration
+#
# Parameters:
-# none
+# $es_url:
+# The URL for Elasticsearch
#
# Sample Usage:
#
# class { 'datadog::integrations::elasticsearch' :
+# es_url => "http://localhost:9201"
# }
#
-class datadog::integrations::elasticsearch inherits datadog::params {
+class datadog::integrations::elasticsearch(
+ $es_url = 'http://localhost:9200'
+) inherits datadog::params {
file { "${datadog::conf_dir}/elastic.yaml":
ensure => file,
owner => $datadog::dd_user,
group => $datadog::dd_group,
mode => '0644',
- source => 'puppet:///modules/datadog/elastic.yaml',
+ content => template('datadog/elastic.yaml.erb'),
require => Package[ 'datadog-agent' ],
notify => Service[ $datadog::service_name ],
}
View
4 templates/elastic.yaml.erb
@@ -0,0 +1,4 @@
+init_config:
+
+instances:
+ - url: <%= es_url %>

0 comments on commit fcb82a6

Please sign in to comment.
Something went wrong with that request. Please try again.