mirror of
https://github.com/krislamo/puppet-fluentd
synced 2025-09-13 17:09:29 +00:00
Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
fc94e7ba6f | ||
|
3fb5293880 | ||
|
e5650f47d1 | ||
|
49848b2afd | ||
|
f4c24ee881 | ||
|
2e789170a0 | ||
|
22a9578a88 | ||
|
9eb19b3d1b | ||
|
6a05cae33e | ||
|
2183f670f2 | ||
|
bcad5ca42c | ||
|
26694848cb | ||
|
bb2346df50 | ||
|
e062d4f2e0 | ||
|
f32ea2c0ba | ||
|
8081e8df20 | ||
|
6cb1364023 | ||
|
3dab36ee83 | ||
|
8916d18654 | ||
|
75a537432c | ||
|
9754e64490 |
16
.travis.yml
16
.travis.yml
@@ -6,12 +6,16 @@ script: bundle exec rake validate && bundle exec rake lint && bundle exec rake s
|
|||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
include:
|
include:
|
||||||
- rvm: 1.9.3
|
- rvm: 2.1.10
|
||||||
env: PUPPET_GEM_VERSION="~> 3.0"
|
env: PUPPET_VERSION="~> 3.0"
|
||||||
- rvm: 2.1.5
|
- rvm: 2.1.10
|
||||||
env: PUPPET_GEM_VERSION="~> 3.0"
|
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
|
||||||
- rvm: 2.1.6
|
- rvm: 2.2.7
|
||||||
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
|
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
|
||||||
|
- rvm: 2.3.4
|
||||||
|
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
|
||||||
|
- rvm: 2.4.1
|
||||||
|
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
|
||||||
notifications:
|
notifications:
|
||||||
slack:
|
slack:
|
||||||
secure: WVBx/OJqLpX9WXyiejEdnOcAf+5ShWJ2gcyeBCX032iKzPphcdPKqH+jnlFaKjqQCZARbRqzlj/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6H5RmuSy+3xRoEbwvyXKUgA+4gL3I3aAIvidBG+yazRBFvRCn4pUJdTEc4Cpu0jhQWXWyZSE66HNPKyIOXl9JPTzul08MDo9OaqBt+K3yeMVA8EPr196mWLwerF+dExQ2PJhUu/7MAiOgFrIr4/d05iKhj4ivLYBRNN317s2NVo8qyfhPHlfv6PyzhllC/qjClQ2rLOemVhg=
|
||||||
|
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,4 +1,16 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
## 0.5.4
|
||||||
|
* fixed templates/filter.erb
|
||||||
|
* fixed removing of old GPG key for yum repos
|
||||||
|
|
||||||
|
## 0.5.3
|
||||||
|
* update treasure data repo gpg key
|
||||||
|
|
||||||
|
## 0.5.2
|
||||||
|
* Correct the docs related to the service_enable parameter
|
||||||
|
|
||||||
|
## 0.5.1
|
||||||
|
* Allow to install specific version of fluent gem plugins
|
||||||
|
|
||||||
## 0.5.0
|
## 0.5.0
|
||||||
* Added support for Debian 6, 7, 8
|
* Added support for Debian 6, 7, 8
|
||||||
|
15
Gemfile
15
Gemfile
@@ -1,10 +1,21 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : ['>= 3.3']
|
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 4.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
|
||||||
gem 'puppet', puppetversion
|
gem 'puppet', puppetversion
|
||||||
gem 'puppetlabs_spec_helper', '>= 0.8.2'
|
gem 'puppetlabs_spec_helper', '>= 0.8.2'
|
||||||
gem 'puppet-lint', '>= 1.0.0'
|
gem 'puppet-lint', '>= 1.0.0'
|
||||||
gem 'facter', '>= 1.7.0'
|
gem 'facter', '>= 1.7.0'
|
||||||
gem 'beaker-rspec'
|
|
||||||
gem 'beaker-puppet_install_helper'
|
gem 'beaker-puppet_install_helper'
|
||||||
gem 'metadata-json-lint'
|
gem 'metadata-json-lint'
|
||||||
|
|
||||||
|
beakerrspec = '> 0'
|
||||||
|
platforms [:ruby_19, :ruby_21] do
|
||||||
|
beakerrspec = '<= 5.6.0'
|
||||||
|
end
|
||||||
|
gem 'beaker-rspec', beakerrspec
|
||||||
|
|
||||||
|
platforms :ruby_19 do
|
||||||
|
gem 'public_suffix', '< 1.5.0', :platforms => :ruby_19
|
||||||
|
gem 'nokogiri', '< 1.7.0', :platforms => :ruby_19
|
||||||
|
gem 'mime-types', '< 3.0', :platforms => :ruby_19
|
||||||
|
end
|
@@ -79,7 +79,7 @@ include '::fluentd'
|
|||||||
Service ensure.
|
Service ensure.
|
||||||
**Default:** 'running'
|
**Default:** 'running'
|
||||||
|
|
||||||
`service_enabled`
|
`service_enable`
|
||||||
|
|
||||||
Defines if the service should be enabled.
|
Defines if the service should be enabled.
|
||||||
**Default:** 'true'
|
**Default:** 'true'
|
||||||
@@ -228,7 +228,8 @@ This module gives you the possibility to install plugins as gem or files.
|
|||||||
**gem installation**
|
**gem installation**
|
||||||
```puppet
|
```puppet
|
||||||
::fluentd::plugin { 'fluent-plugin-elasticsearch':
|
::fluentd::plugin { 'fluent-plugin-elasticsearch':
|
||||||
type => 'gem'
|
type => 'gem',
|
||||||
|
ensure => '0.1.3'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
**file installation**
|
**file installation**
|
||||||
|
19
Rakefile
19
Rakefile
@@ -1,7 +1,22 @@
|
|||||||
require 'puppetlabs_spec_helper/rake_tasks'
|
require 'puppetlabs_spec_helper/rake_tasks'
|
||||||
require 'puppet-lint/tasks/puppet-lint'
|
require 'puppet-lint/tasks/puppet-lint'
|
||||||
PuppetLint.configuration.send('disable_80chars')
|
|
||||||
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
|
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
|
||||||
|
PuppetLint.configuration.fail_on_warnings = true
|
||||||
|
PuppetLint.configuration.send('relative')
|
||||||
|
PuppetLint.configuration.send('disable_140chars')
|
||||||
|
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
||||||
|
PuppetLint.configuration.send('disable_documentation')
|
||||||
|
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
|
||||||
|
|
||||||
|
exclude_paths = %w(
|
||||||
|
pkg/**/*
|
||||||
|
vendor/**/*
|
||||||
|
.vendor/**/*
|
||||||
|
spec/**/*
|
||||||
|
)
|
||||||
|
PuppetLint.configuration.ignore_paths = exclude_paths
|
||||||
|
PuppetSyntax.exclude_paths = exclude_paths
|
||||||
|
|
||||||
desc "Validate manifests, templates, and ruby files"
|
desc "Validate manifests, templates, and ruby files"
|
||||||
task :validate do
|
task :validate do
|
||||||
|
@@ -5,5 +5,5 @@
|
|||||||
# file installation
|
# file installation
|
||||||
::fluentd::plugin { 'fluent-plugin-elasticsearch':
|
::fluentd::plugin { 'fluent-plugin-elasticsearch':
|
||||||
type => 'file',
|
type => 'file',
|
||||||
source => 'puppet:///path/to/plugin'
|
source => 'puppet:///modules/path/to/plugin'
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
# [*service_ensure*]
|
# [*service_ensure*]
|
||||||
# Service ensure
|
# Service ensure
|
||||||
# Default: 'running'
|
# Default: 'running'
|
||||||
# [*service_enabled*]
|
# [*service_enable*]
|
||||||
# Defines if the service should be enabled
|
# Defines if the service should be enabled
|
||||||
# Default: 'true'
|
# Default: 'true'
|
||||||
# [*user_manage*]
|
# [*user_manage*]
|
||||||
@@ -91,9 +91,9 @@ class fluentd (
|
|||||||
include '::fluentd::service'
|
include '::fluentd::service'
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
Class['::Fluentd::Repo'] ->
|
Class['::Fluentd::Repo']
|
||||||
Class['::Fluentd::Install'] ->
|
-> Class['::Fluentd::Install']
|
||||||
Class['::Fluentd::User'] ->
|
-> Class['::Fluentd::User']
|
||||||
Class['::Fluentd::Config'] ->
|
-> Class['::Fluentd::Config']
|
||||||
Class['::Fluentd::Service']
|
-> Class['::Fluentd::Service']
|
||||||
}
|
}
|
||||||
|
@@ -31,11 +31,6 @@ define fluentd::plugin (
|
|||||||
$source = undef,
|
$source = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
# parameter validation
|
|
||||||
if ! ($ensure in [ 'present', 'absent' ]) {
|
|
||||||
fail('ensure parameter must be present or absent')
|
|
||||||
}
|
|
||||||
|
|
||||||
case $type {
|
case $type {
|
||||||
'gem': {
|
'gem': {
|
||||||
fluentd::plugin::gem { $name:
|
fluentd::plugin::gem { $name:
|
||||||
@@ -44,6 +39,10 @@ define fluentd::plugin (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
'file': {
|
'file': {
|
||||||
|
# parameter validation
|
||||||
|
if ! ($ensure in [ 'present', 'absent' ]) {
|
||||||
|
fail('ensure parameter must be present or absent')
|
||||||
|
}
|
||||||
validate_string($source)
|
validate_string($source)
|
||||||
|
|
||||||
fluentd::plugin::file { $name:
|
fluentd::plugin::file { $name:
|
||||||
|
@@ -7,7 +7,7 @@ class fluentd::repo::apt (
|
|||||||
$repos = 'contrib',
|
$repos = 'contrib',
|
||||||
$architecture = $::architecture,
|
$architecture = $::architecture,
|
||||||
$key = {
|
$key = {
|
||||||
'id' => 'C901622B5EC4AF820C38AB861093DB45A12E206F',
|
'id' => 'BEE682289B2217F45AF4CC3F901F9177AB97ACBE',
|
||||||
'source' => 'http://packages.treasuredata.com/GPG-KEY-td-agent'
|
'source' => 'http://packages.treasuredata.com/GPG-KEY-td-agent'
|
||||||
},
|
},
|
||||||
$include = {
|
$include = {
|
||||||
|
@@ -23,4 +23,12 @@ class fluentd::repo::yum (
|
|||||||
path => '/bin:/usr/bin/',
|
path => '/bin:/usr/bin/',
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec { 'remove old GPG key':
|
||||||
|
command => 'rpm -e --allmatches gpg-pubkey-a12e206f-*',
|
||||||
|
path => '/bin:/usr/bin/',
|
||||||
|
onlyif => 'rpm -qi gpg-pubkey-a12e206f-*',
|
||||||
|
notify => Exec['add GPG key'],
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wywygmbh-fluentd",
|
"name": "wywygmbh-fluentd",
|
||||||
"version": "0.5.0",
|
"version": "0.5.4",
|
||||||
"author": "wywy GmbH",
|
"author": "wywy GmbH",
|
||||||
"summary": "Generic module for fluentd (td-agent).",
|
"summary": "Generic module for fluentd (td-agent).",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
@@ -27,6 +27,7 @@ describe 'fluentd::config', :type => :class do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@ describe 'fluentd::install', :type => :class do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include_examples 'when called with no parameters'
|
include_examples 'when called with no parameters'
|
||||||
|
@@ -21,7 +21,7 @@ describe 'fluentd::repo::apt', :type => :class do
|
|||||||
'repos' => 'contrib',
|
'repos' => 'contrib',
|
||||||
'architecture' => 'amd64',
|
'architecture' => 'amd64',
|
||||||
'key' => {
|
'key' => {
|
||||||
'id' => 'C901622B5EC4AF820C38AB861093DB45A12E206F',
|
'id' => 'BEE682289B2217F45AF4CC3F901F9177AB97ACBE',
|
||||||
'source' => 'http://packages.treasuredata.com/GPG-KEY-td-agent'
|
'source' => 'http://packages.treasuredata.com/GPG-KEY-td-agent'
|
||||||
},
|
},
|
||||||
'include' => {
|
'include' => {
|
||||||
|
@@ -9,6 +9,7 @@ describe 'fluentd::repo', :type => :class do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
it {
|
it {
|
||||||
|
@@ -20,6 +20,7 @@ describe 'fluentd::config', :type => :class do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,6 +17,7 @@ describe 'fluentd', :type => :class do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@ describe 'fluentd::user', :type => :class do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ describe 'fluentd::filter' do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let(:pre_condition) { 'include fluentd' }
|
let(:pre_condition) { 'include fluentd' }
|
||||||
|
@@ -7,6 +7,7 @@ describe 'fluentd::match' do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let(:pre_condition) { 'include fluentd' }
|
let(:pre_condition) { 'include fluentd' }
|
||||||
|
@@ -7,6 +7,7 @@ describe 'fluentd::plugin' do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let(:pre_condition) { 'include fluentd' }
|
let(:pre_condition) { 'include fluentd' }
|
||||||
|
@@ -7,6 +7,7 @@ describe 'fluentd::source' do
|
|||||||
:lsbdistid => 'Ubuntu',
|
:lsbdistid => 'Ubuntu',
|
||||||
:operatingsystem => 'Ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
:lsbdistcodename => 'precise',
|
:lsbdistcodename => 'precise',
|
||||||
|
:architecture => 'amd64',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let(:pre_condition) { 'include fluentd' }
|
let(:pre_condition) { 'include fluentd' }
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
<% @config.each do |key, val| -%>
|
<% @config.each do |key, val| -%>
|
||||||
<%- if val.is_a?( Hash ) -%>
|
<%- if val.is_a?( Hash ) -%>
|
||||||
<<%= key -%>>
|
<<%= key -%>>
|
||||||
<%- val.each do |key, val| -%>
|
<%- val.each do |key2, val2| -%>
|
||||||
<%= key -%> <%= val %>
|
<%= key2 -%> <%= val2 %>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
</<%= key %>>
|
</<%= key %>>
|
||||||
<%- else -%>
|
<%- else -%>
|
||||||
|
Reference in New Issue
Block a user