From adad6151e30cd8a6e78f15a5ea643c18c9d2c3cb Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Fri, 11 Jul 2014 17:07:41 -0400 Subject: [PATCH] logging: instantiate dedicated ES instance and fluentd refresh on change * Elasticsearch spawns a dedicated instance named fluentd for its usage * Fluentd change weren't taking in account, now it does --- .fixtures.yml | 2 +- Puppetfile | 2 +- manifests/logging/agent.pp | 4 ++-- manifests/logging/server.pp | 1 + spec/classes/cloud_logging_server.rb | 4 ++++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 3cc41122..3a113ba6 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -59,7 +59,7 @@ fixtures: ref: '0df1f62130a7752c728efb7555f2b07ca178ee5b' 'fluentd': repo: 'git://github.com/enovance/puppet-fluentd.git' - ref: '93ea059e21850c22f1ca079cbacd51b548d3b1b3' + ref: 'da0ce0a3de340b671c243a5550a27532e6679da2' 'haproxy': repo: 'git://github.com/enovance/puppetlabs-haproxy.git' ref: 'fc1166f28d411dfd4f59d4bfd6936595c014a11b' diff --git a/Puppetfile b/Puppetfile index 0bc5c3b6..f503f00a 100644 --- a/Puppetfile +++ b/Puppetfile @@ -85,7 +85,7 @@ mod 'firewall', :ref => '6540b31b0ca0727094ddf44436274436d2853d6d' mod 'fluentd', :git => 'git://github.com/enovance/puppet-fluentd.git', - :ref => '93ea059e21850c22f1ca079cbacd51b548d3b1b3' + :ref => 'da0ce0a3de340b671c243a5550a27532e6679da2' mod 'haproxy', :git => 'git://github.com/enovance/puppetlabs-haproxy.git', :ref => 'fc1166f28d411dfd4f59d4bfd6936595c014a11b' diff --git a/manifests/logging/agent.pp b/manifests/logging/agent.pp index b236bc69..94c184bc 100644 --- a/manifests/logging/agent.pp +++ b/manifests/logging/agent.pp @@ -60,8 +60,8 @@ class cloud::logging::agent( ensure_resource('fluentd::configfile', keys($sources)) ensure_resource('fluentd::configfile', keys($matches)) - create_resources('fluentd::source', $sources, {'require' => 'File[/var/db/td-agent]'}) - create_resources('fluentd::match', $matches) + create_resources('fluentd::source', $sources, {'require' => 'File[/var/db/td-agent]', 'notify' => 'Service[td-agent]'}) + create_resources('fluentd::match', $matches, {'notify' => 'Service[td-agent]'}) create_resources('fluentd::install_plugin', $plugins) } diff --git a/manifests/logging/server.pp b/manifests/logging/server.pp index ad32f951..0e9fdf8d 100644 --- a/manifests/logging/server.pp +++ b/manifests/logging/server.pp @@ -21,5 +21,6 @@ class cloud::logging::server{ include ::elasticsearch include ::kibana3 include cloud::logging::agent + elasticsearch::instance {'fluentd' : } } diff --git a/spec/classes/cloud_logging_server.rb b/spec/classes/cloud_logging_server.rb index 17bec47a..e982b002 100644 --- a/spec/classes/cloud_logging_server.rb +++ b/spec/classes/cloud_logging_server.rb @@ -34,6 +34,10 @@ describe 'cloud::logging::server' do it 'configure kibana' do should contain_class('kibana3').with(:ws_port => '8001') end + + it 'configure an elasticsearch instance' do + should contain_elasticsearch__instance('fluentd') + end end context 'on Debian platforms' do