mirror of
https://github.com/krislamo/puppet-fluentd
synced 2025-09-13 08:59:29 +00:00
Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
71352ea6b1 | ||
|
d7ab62a388 | ||
|
78f9c03952 | ||
|
ca55558b44 | ||
|
cd9813f574 | ||
|
d6231c3b13 | ||
|
fc0f3fdf88 | ||
|
613a28ccaf | ||
|
5f213da8b3 | ||
|
258a37ff11 | ||
|
c2f95f4bc9 | ||
|
257880811c | ||
|
6e97016aac | ||
|
b34c7dc4e4 | ||
|
d7f6d91a11 | ||
|
e8cdc9a9e0 | ||
|
b51a559684 | ||
|
754cd4a696 | ||
|
41a617c156 | ||
|
0c62c616f0 | ||
|
76d26e8216 | ||
|
780df1edae | ||
|
3e3de2aed9 | ||
|
5f84f04f0f | ||
|
ad17694713 | ||
|
f4da637999 | ||
|
533857e49c | ||
|
525fc9c5ab | ||
|
bfa6de193e | ||
|
5f3aca9597 | ||
|
ee3a8e968a | ||
|
3f26736084 | ||
|
d27479eb17 | ||
|
c8046ee2c6 | ||
|
fc94e7ba6f | ||
|
3fb5293880 | ||
|
e5650f47d1 | ||
|
49848b2afd | ||
|
f4c24ee881 | ||
|
2e789170a0 | ||
|
22a9578a88 | ||
|
9eb19b3d1b | ||
|
6a05cae33e | ||
|
2183f670f2 | ||
|
bcad5ca42c | ||
|
26694848cb |
16
.travis.yml
16
.travis.yml
@@ -6,12 +6,16 @@ script: bundle exec rake validate && bundle exec rake lint && bundle exec rake s
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- rvm: 1.9.3
|
||||
env: PUPPET_GEM_VERSION="~> 3.0"
|
||||
- rvm: 2.1.5
|
||||
env: PUPPET_GEM_VERSION="~> 3.0"
|
||||
- rvm: 2.1.6
|
||||
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
|
||||
- rvm: 2.1.10
|
||||
env: PUPPET_VERSION="~> 3.0"
|
||||
- rvm: 2.1.10
|
||||
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
|
||||
- rvm: 2.2.7
|
||||
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:
|
||||
slack:
|
||||
secure: WVBx/OJqLpX9WXyiejEdnOcAf+5ShWJ2gcyeBCX032iKzPphcdPKqH+jnlFaKjqQCZARbRqzlj/if3FZWAlhWtTrWrcY545dRHcsaGvJ/nMtdHlBUuwUNHipSn+RTXtorsYz0efhJMPye2LMl0HgAp3rEs70XUt8rZOwdedLGVgfWRwM+KixhSf8P08v9QjNRNdhWII37KFRdqv/NHryNlVKsTLH6fQOyIvok3vrTvMR8rWMRETXv6JLpCJ3FfOrxo53fW7q+GlXXuVcQ2OGlgxm3eke6q2aXZAqczeB5CSlWgUEA5T3rQ//WI3enwTayRajV/9O26HZvASjSTnDRiSSv1itYqg1Uy6kuJy5ANpBizOyWY6/QTM5Rw00AXvaY9ur0EmyNe5vLNHyTxzdr4R+rXjE07yCDvWM9RGbu+4BipP+mAoJTkuCIP54FWYn1qOJnC8DYywD/+wniCNLbp6yMgbG/aC6H5RmuSy+3xRoEbwvyXKUgA+4gL3I3aAIvidBG+yazRBFvRCn4pUJdTEc4Cpu0jhQWXWyZSE66HNPKyIOXl9JPTzul08MDo9OaqBt+K3yeMVA8EPr196mWLwerF+dExQ2PJhUu/7MAiOgFrIr4/d05iKhj4ivLYBRNN317s2NVo8qyfhPHlfv6PyzhllC/qjClQ2rLOemVhg=
|
||||
|
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,4 +1,23 @@
|
||||
# Changelog
|
||||
## 0.6.0
|
||||
* Updated README
|
||||
* fixed broken links, due to github organisation rename
|
||||
* fixed indentation for config files (filter, match, source)
|
||||
* use rspec-puppet-facts for unit testing
|
||||
|
||||
## 0.5.6
|
||||
* Fixed `conf_dir_manage` parameter call
|
||||
|
||||
## 0.5.5
|
||||
* Added `conf_dir_manage` parameter (Default: false)
|
||||
* Exclusively handle config files into fluentd::conf_dir. Other files not created by puppet, will be deleted
|
||||
|
||||
## 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
|
||||
|
16
Gemfile
16
Gemfile
@@ -1,10 +1,22 @@
|
||||
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 'puppetlabs_spec_helper', '>= 0.8.2'
|
||||
gem 'puppet-lint', '>= 1.0.0'
|
||||
gem 'facter', '>= 1.7.0'
|
||||
gem 'beaker-rspec'
|
||||
gem 'beaker-puppet_install_helper'
|
||||
gem 'metadata-json-lint'
|
||||
gem 'rspec-puppet-facts', '~> 1.7'
|
||||
|
||||
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
|
2
LICENSE
2
LICENSE
@@ -186,7 +186,7 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2015 wywy GmbH
|
||||
Copyright 2017 ATVAG GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
30
README.md
30
README.md
@@ -1,7 +1,7 @@
|
||||
# wywygmbh/fluentd Puppet Module
|
||||
# wywy/fluentd Puppet Module
|
||||
|
||||
[](https://github.com/wywygmbh/puppet-fluentd)
|
||||
[](https://travis-ci.org/wywygmbh/puppet-fluentd)
|
||||
[](https://github.com/wywy/puppet-fluentd)
|
||||
[](https://travis-ci.org/wywy/puppet-fluentd)
|
||||
|
||||
|
||||
|
||||
@@ -84,6 +84,26 @@ include '::fluentd'
|
||||
Defines if the service should be enabled.
|
||||
**Default:** 'true'
|
||||
|
||||
`config_path`
|
||||
|
||||
Path to configuration files
|
||||
**Default:** '/etc/td-agent'
|
||||
|
||||
`config_dir`
|
||||
|
||||
Configuration directory name
|
||||
**Default:** '${config_path}/conf.d'
|
||||
|
||||
`config_file`
|
||||
|
||||
Default configuration file name
|
||||
**Default:** '${config_path}/td-agent.conf'
|
||||
|
||||
`conf_dir_manage`
|
||||
|
||||
Exclusively handle config files into fluentd::conf_dir. Other files not created by puppet, will be deleted
|
||||
**Default:** 'false'
|
||||
|
||||
`user_manage`
|
||||
|
||||
Defines if the user should be manage, which will add the user
|
||||
@@ -276,7 +296,7 @@ bundle exec rake beaker BEAKER_set=centos-70-x64
|
||||
|
||||
## License
|
||||
|
||||
Copyright 2015 wywy GmbH
|
||||
Copyright 2017 ATVAG GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -290,4 +310,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
This Puppet module is being actively maintained by some fellow puppeteers at [wywy GmbH](http://wywy.com/).
|
||||
This Puppet module is being actively maintained by some fellow puppeteers at [wywy](http://wywy.com/).
|
||||
|
19
Rakefile
19
Rakefile
@@ -1,8 +1,23 @@
|
||||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
|
||||
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('relative')
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_puppet_url_without_modules')
|
||||
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
|
||||
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
||||
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"
|
||||
task :validate do
|
||||
|
@@ -5,5 +5,5 @@
|
||||
# file installation
|
||||
::fluentd::plugin { 'fluent-plugin-elasticsearch':
|
||||
type => 'file',
|
||||
source => 'puppet://path/to/plugin'
|
||||
source => 'puppet:///modules/path/to/plugin'
|
||||
}
|
||||
|
@@ -11,9 +11,11 @@ class fluentd::config inherits fluentd {
|
||||
}
|
||||
|
||||
file { $::fluentd::conf_dir:
|
||||
ensure => 'directory',
|
||||
owner => $::fluentd::user_name,
|
||||
group => $::fluentd::user_group,
|
||||
mode => '0750',
|
||||
ensure => 'directory',
|
||||
recurse => $::fluentd::conf_dir_manage,
|
||||
purge => $::fluentd::conf_dir_manage,
|
||||
owner => $::fluentd::user_name,
|
||||
group => $::fluentd::user_group,
|
||||
mode => '0750',
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@
|
||||
# Copyright
|
||||
# ---------
|
||||
#
|
||||
# Copyright 2015 wywy GmbH, unless otherwise noted.
|
||||
# Copyright 2015 wywy, unless otherwise noted.
|
||||
#
|
||||
define fluentd::filter (
|
||||
$ensure = present,
|
||||
|
@@ -29,6 +29,18 @@
|
||||
# [*service_enable*]
|
||||
# Defines if the service should be enabled
|
||||
# Default: 'true'
|
||||
# [*config_path*]
|
||||
# Path to configuration files
|
||||
# Default: '/etc/td-agent'
|
||||
# [*config_dir*]
|
||||
# Configuration directory name
|
||||
# Default: '${config_path}/conf.d'
|
||||
# [*config_file*]
|
||||
# Default configuration file name
|
||||
# Default: '${config_path}/td-agent.conf'
|
||||
# [*conf_dir_manage*]
|
||||
# Exclusively handle config files into fluentd::conf_dir. Other files not created by puppet, will be deleted
|
||||
# Default: 'false'
|
||||
# [*user_manage*]
|
||||
# Defines if the user should be manage, which will add the user
|
||||
# to groups defined in $user_groups.
|
||||
@@ -50,7 +62,7 @@
|
||||
# Copyright
|
||||
# ---------
|
||||
#
|
||||
# Copyright 2015 wywy GmbH, unless otherwise noted.
|
||||
# Copyright 2015 wywy, unless otherwise noted.
|
||||
#
|
||||
class fluentd (
|
||||
$repo_manage = $::fluentd::params::repo_manage,
|
||||
@@ -64,6 +76,7 @@ class fluentd (
|
||||
$config_path = $::fluentd::params::config_path,
|
||||
$conf_dir = $::fluentd::params::conf_dir,
|
||||
$config_file = $::fluentd::params::config_file,
|
||||
$conf_dir_manage = $::fluentd::params::conf_dir_manage,
|
||||
$user_manage = $::fluentd::params::user_manage,
|
||||
$user_name = $::fluentd::params::user_name,
|
||||
$user_group = $::fluentd::params::user_group,
|
||||
@@ -91,9 +104,9 @@ class fluentd (
|
||||
include '::fluentd::service'
|
||||
|
||||
# dependencies
|
||||
Class['::Fluentd::Repo'] ->
|
||||
Class['::Fluentd::Install'] ->
|
||||
Class['::Fluentd::User'] ->
|
||||
Class['::Fluentd::Config'] ->
|
||||
Class['::Fluentd::Service']
|
||||
Class['::Fluentd::Repo']
|
||||
-> Class['::Fluentd::Install']
|
||||
-> Class['::Fluentd::User']
|
||||
-> Class['::Fluentd::Config']
|
||||
-> Class['::Fluentd::Service']
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@
|
||||
# Copyright
|
||||
# ---------
|
||||
#
|
||||
# Copyright 2015 wywy GmbH, unless otherwise noted.
|
||||
# Copyright 2015 wywy, unless otherwise noted.
|
||||
#
|
||||
define fluentd::match (
|
||||
$ensure = present,
|
||||
|
@@ -11,6 +11,7 @@ class fluentd::params {
|
||||
# config params
|
||||
$config_path = '/etc/td-agent'
|
||||
$conf_dir = "${config_path}/conf.d"
|
||||
$conf_dir_manage = false
|
||||
$config_file = "${config_path}/td-agent.conf"
|
||||
# user params
|
||||
$user_manage = true
|
||||
|
@@ -23,7 +23,7 @@
|
||||
# Copyright
|
||||
# ---------
|
||||
#
|
||||
# Copyright 2015 wywy GmbH, unless otherwise noted.
|
||||
# Copyright 2015 wywy, unless otherwise noted.
|
||||
#
|
||||
define fluentd::plugin (
|
||||
$ensure = present,
|
||||
|
@@ -7,7 +7,7 @@ class fluentd::repo::apt (
|
||||
$repos = 'contrib',
|
||||
$architecture = $::architecture,
|
||||
$key = {
|
||||
'id' => 'C901622B5EC4AF820C38AB861093DB45A12E206F',
|
||||
'id' => 'BEE682289B2217F45AF4CC3F901F9177AB97ACBE',
|
||||
'source' => 'http://packages.treasuredata.com/GPG-KEY-td-agent'
|
||||
},
|
||||
$include = {
|
||||
|
@@ -23,4 +23,12 @@ class fluentd::repo::yum (
|
||||
path => '/bin:/usr/bin/',
|
||||
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'],
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@
|
||||
# Copyright
|
||||
# ---------
|
||||
#
|
||||
# Copyright 2015 wywy GmbH, unless otherwise noted.
|
||||
# Copyright 2015 wywy, unless otherwise noted.
|
||||
#
|
||||
define fluentd::source (
|
||||
$ensure = present,
|
||||
|
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "wywygmbh-fluentd",
|
||||
"version": "0.5.2",
|
||||
"author": "wywy GmbH",
|
||||
"version": "0.6.0",
|
||||
"author": "wywy",
|
||||
"summary": "Generic module for fluentd (td-agent).",
|
||||
"license": "Apache-2.0",
|
||||
"source": "https://github.com/wywygmbh/puppet-fluentd",
|
||||
"project_page": "https://github.com/wywygmbh/puppet-fluentd",
|
||||
"issues_url": "https://github.com/wywygmbh/puppet-fluentd/issues",
|
||||
"source": "https://github.com/wywy/puppet-fluentd",
|
||||
"project_page": "https://github.com/wywy/puppet-fluentd",
|
||||
"issues_url": "https://github.com/wywy/puppet-fluentd/issues",
|
||||
"tags": ["fluentd", "td-agent"],
|
||||
"operatingsystem_support": [
|
||||
{
|
||||
|
@@ -1,46 +1,31 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::config', :type => :class do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_file('/etc/td-agent/td-agent.conf').with({
|
||||
'ensure' => 'file',
|
||||
'owner' => 'root',
|
||||
'group' => 'root',
|
||||
'source' => 'puppet:///modules/fluentd/td-agent.conf',
|
||||
'notify' => 'Class[Fluentd::Service]'
|
||||
})
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
should contain_file('/etc/td-agent/conf.d').with({
|
||||
'ensure' => 'directory',
|
||||
'owner' => 'td-agent',
|
||||
'group' => 'td-agent',
|
||||
'mode' => '0750'
|
||||
})
|
||||
}
|
||||
end
|
||||
describe 'when called with no parameters' do
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
it {
|
||||
should contain_file('/etc/td-agent/td-agent.conf').with({
|
||||
'ensure' => 'file',
|
||||
'owner' => 'root',
|
||||
'group' => 'root',
|
||||
'source' => 'puppet:///modules/fluentd/td-agent.conf',
|
||||
'notify' => 'Class[Fluentd::Service]'
|
||||
})
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
should contain_file('/etc/td-agent/conf.d').with({
|
||||
'ensure' => 'directory',
|
||||
'owner' => 'td-agent',
|
||||
'group' => 'td-agent',
|
||||
'mode' => '0750'
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -1,38 +1,21 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::install', :type => :class do
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_package('fluentd').with({
|
||||
'ensure' => 'installed',
|
||||
'name' => 'td-agent',
|
||||
'install_options' => []
|
||||
})
|
||||
}
|
||||
describe 'when called with no parameters' do
|
||||
it {
|
||||
should contain_package('fluentd').with({
|
||||
'ensure' => 'installed',
|
||||
'name' => 'td-agent',
|
||||
'install_options' => []
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
end
|
||||
|
@@ -1,34 +1,81 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::repo::apt', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
it {
|
||||
should contain_class('apt')
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'ensure' => 'present',
|
||||
'location' => 'http://packages.treasuredata.com/2/ubuntu/precise',
|
||||
'release' => 'precise',
|
||||
'repos' => 'contrib',
|
||||
'architecture' => 'amd64',
|
||||
'key' => {
|
||||
'id' => 'C901622B5EC4AF820C38AB861093DB45A12E206F',
|
||||
'source' => 'http://packages.treasuredata.com/GPG-KEY-td-agent'
|
||||
},
|
||||
'include' => {
|
||||
'src' => false,
|
||||
'deb' => true
|
||||
case facts[:osfamily]
|
||||
when 'Debian'
|
||||
it {
|
||||
should contain_class('apt')
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'ensure' => 'present',
|
||||
'repos' => 'contrib',
|
||||
'architecture' => 'amd64',
|
||||
'key' => {
|
||||
'id' => 'BEE682289B2217F45AF4CC3F901F9177AB97ACBE',
|
||||
'source' => 'http://packages.treasuredata.com/GPG-KEY-td-agent'
|
||||
},
|
||||
'include' => {
|
||||
'src' => false,
|
||||
'deb' => true
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
case facts[:operatingsystem]
|
||||
when 'Ubuntu'
|
||||
case facts[:lsbdistcodename]
|
||||
when 'precise'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/ubuntu/precise',
|
||||
'release' => 'precise'
|
||||
})
|
||||
}
|
||||
when 'trusty'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/ubuntu/trusty',
|
||||
'release' => 'trusty'
|
||||
})
|
||||
}
|
||||
when 'xenial'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/ubuntu/xenial',
|
||||
'release' => 'xenial'
|
||||
})
|
||||
}
|
||||
end
|
||||
when 'Debian'
|
||||
case facts[:lsbdistcodename]
|
||||
when 'jessie'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/debian/jessie',
|
||||
'release' => 'jessie'
|
||||
})
|
||||
}
|
||||
when 'squeeze'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/debian/squeeze',
|
||||
'release' => 'squeeze'
|
||||
})
|
||||
}
|
||||
when 'wheezy'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/debian/wheezy',
|
||||
'release' => 'wheezy'
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -1,30 +1,21 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::repo', :type => :class do
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
context 'when called with no parameters on osfamily Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
it {
|
||||
should contain_class('fluentd::repo::apt')
|
||||
}
|
||||
end
|
||||
|
||||
context 'when called with no parameters on osfamily RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
it {
|
||||
should contain_class('fluentd::repo::yum')
|
||||
}
|
||||
describe 'when called with no parameters' do
|
||||
case facts[:osfamily]
|
||||
when 'Debian'
|
||||
it { is_expected.to contain_class('fluentd::repo::apt') }
|
||||
when 'RedHat'
|
||||
it { is_expected.to contain_class('fluentd::repo::yum') }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@@ -1,27 +1,32 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::repo::yum', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
describe 'when called with no parameters on RedHat' do
|
||||
it {
|
||||
should contain_yumrepo('treasure-data').with({
|
||||
'ensure' => 'present',
|
||||
'baseurl' => 'https://packages.treasuredata.com/2/redhat/$releasever/$basearch',
|
||||
'descr' => 'TreasureData',
|
||||
'enabled' => '1',
|
||||
'gpgcheck' => '1'
|
||||
}).that_notifies('Exec[add GPG key]')
|
||||
describe 'when called with no parameters' do
|
||||
case facts[:osfamily]
|
||||
when 'RedHat'
|
||||
it {
|
||||
should contain_yumrepo('treasure-data').with({
|
||||
'ensure' => 'present',
|
||||
'baseurl' => 'https://packages.treasuredata.com/2/redhat/$releasever/$basearch',
|
||||
'descr' => 'TreasureData',
|
||||
'enabled' => '1',
|
||||
'gpgcheck' => '1'
|
||||
}).that_notifies('Exec[add GPG key]')
|
||||
|
||||
should contain_exec('add GPG key').with({
|
||||
'command' => 'rpm --import https://packages.treasuredata.com/GPG-KEY-td-agent',
|
||||
'path' => '/bin:/usr/bin/',
|
||||
'refreshonly' => 'true'
|
||||
})
|
||||
}
|
||||
should contain_exec('add GPG key').with({
|
||||
'command' => 'rpm --import https://packages.treasuredata.com/GPG-KEY-td-agent',
|
||||
'path' => '/bin:/usr/bin/',
|
||||
'refreshonly' => 'true'
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -1,39 +1,23 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::config', :type => :class do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_service('fluentd').with({
|
||||
'name' => 'td-agent',
|
||||
'ensure' => 'running',
|
||||
'enable' => 'true',
|
||||
'hasstatus' => 'true',
|
||||
'hasrestart' => 'true'
|
||||
})
|
||||
}
|
||||
end
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
describe 'when called with no parameters' do
|
||||
it {
|
||||
should contain_service('fluentd').with({
|
||||
'name' => 'td-agent',
|
||||
'ensure' => 'running',
|
||||
'enable' => 'true',
|
||||
'hasstatus' => 'true',
|
||||
'hasrestart' => 'true'
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -1,37 +1,20 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd', :type => :class do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_class('fluentd::repo')
|
||||
should contain_class('fluentd::install')
|
||||
should contain_class('fluentd::config')
|
||||
should contain_class('fluentd::service')
|
||||
}
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
describe 'when called with no parameters' do
|
||||
it {
|
||||
should contain_class('fluentd::repo')
|
||||
should contain_class('fluentd::install')
|
||||
should contain_class('fluentd::config')
|
||||
should contain_class('fluentd::service')
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
end
|
||||
|
@@ -1,37 +1,21 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::user', :type => :class do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_user('fluentd').with({
|
||||
'name' => 'td-agent',
|
||||
'gid' => 'td-agent',
|
||||
'groups' => ['adm']
|
||||
})
|
||||
}
|
||||
end
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
describe 'when called with no parameters' do
|
||||
it {
|
||||
should contain_user('fluentd').with({
|
||||
'name' => 'td-agent',
|
||||
'gid' => 'td-agent',
|
||||
'groups' => ['adm']
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -1,40 +1,34 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::filter' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
context 'basic filter' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '20',
|
||||
pattern: '*.test',
|
||||
config: {
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
|
||||
describe 'basic filter' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '20',
|
||||
pattern: '*.test',
|
||||
config: {
|
||||
'type' => 'record_transformer',
|
||||
'record' => {
|
||||
'hostname' => '${hostname}'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
is_expected.to contain_file('/etc/td-agent/conf.d/20-filter-test.conf').
|
||||
with_content(/<filter \*.test>/).
|
||||
with_content(/type record_transformer/).
|
||||
with_content(/<record>/).
|
||||
with_content(/hostname \$\{hostname\}/).
|
||||
with_content(/<\/record>/).
|
||||
with_content(/<\/filter>/)
|
||||
it do
|
||||
is_expected.to contain_file('/etc/td-agent/conf.d/20-filter-test.conf').
|
||||
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/filter_record_transformer.conf')))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@@ -1,94 +1,71 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::match' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
context 'basic match' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '30',
|
||||
pattern: '*.test',
|
||||
config: {
|
||||
'flush_interval' => '30s',
|
||||
'type' => 'secure_forward',
|
||||
'secure' => 'yes',
|
||||
'shared_key' => 'my_shared_key',
|
||||
'self_hostname' => 'instance.test.com',
|
||||
'ca_cert_path' => '/path/to/ca.cert',
|
||||
'server' => [
|
||||
{
|
||||
'host' => 'test.server.com',
|
||||
}
|
||||
]
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
|
||||
describe 'basic match' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '30',
|
||||
pattern: '*.test',
|
||||
config: {
|
||||
'flush_interval' => '30s',
|
||||
'type' => 'secure_forward',
|
||||
'secure' => 'yes',
|
||||
'shared_key' => 'my_shared_key',
|
||||
'self_hostname' => 'instance.test.com',
|
||||
'ca_cert_path' => '/path/to/ca.cert',
|
||||
'server' => [
|
||||
{
|
||||
'host' => 'test.server.com',
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
|
||||
with_content(/<match \*.test>/).
|
||||
with_content(/flush_interval 30s/).
|
||||
with_content(/type secure_forward/).
|
||||
with_content(/secure yes/).
|
||||
with_content(/shared_key my_shared_key/).
|
||||
with_content(/self_hostname instance.test.com/).
|
||||
with_content(/ca_cert_path \/path\/to\/ca.cert/).
|
||||
with_content(/<server>/).
|
||||
with_content(/host test.server.com/).
|
||||
with_content(/<\/server>/).
|
||||
with_content(/<\/match>/)
|
||||
end
|
||||
end
|
||||
it do
|
||||
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
|
||||
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_secure_forward.conf')))
|
||||
end
|
||||
end
|
||||
|
||||
context 'multiple store' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '30',
|
||||
pattern: '*.test',
|
||||
config: {
|
||||
'type' => 'copy',
|
||||
'store' => [
|
||||
{
|
||||
'type' => 'elasticsearch',
|
||||
'logstashformat' => true,
|
||||
'hosts' => '172.20.10.17:9200',
|
||||
'flush_interval' => '30s',
|
||||
},
|
||||
{
|
||||
'type' => 'file',
|
||||
'path' => '/tmp/td-agent-debug.log',
|
||||
}
|
||||
]
|
||||
describe 'multiple store' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '30',
|
||||
pattern: '*.test',
|
||||
config: {
|
||||
'type' => 'copy',
|
||||
'store' => [
|
||||
{
|
||||
'type' => 'elasticsearch',
|
||||
'logstashformat' => true,
|
||||
'hosts' => '172.20.10.17:9200',
|
||||
'flush_interval' => '30s',
|
||||
},
|
||||
{
|
||||
'type' => 'file',
|
||||
'path' => '/tmp/td-agent-debug.log',
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
|
||||
with_content(/<match \*.test>/).
|
||||
with_content(/type copy/).
|
||||
with_content(/<store>/).
|
||||
with_content(/type elasticsearch/).
|
||||
with_content(/logstashformat true/).
|
||||
with_content(/hosts 172.20.10.17:9200/).
|
||||
with_content(/flush_interval 30s/).
|
||||
with_content(/<\/store>/).
|
||||
with_content(/<store>/).
|
||||
with_content(/type file/).
|
||||
with_content(/path \/tmp\/td-agent-debug.log/).
|
||||
with_content(/<\/store>/).
|
||||
with_content(/<\/match>/)
|
||||
it do
|
||||
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
|
||||
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_copy.conf')))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -1,52 +1,51 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::plugin' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
context 'gem plugin' do
|
||||
let(:title) { 'fluent-plugin-elasticsearch' }
|
||||
let(:params) do
|
||||
{
|
||||
type: 'gem'
|
||||
}
|
||||
end
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
|
||||
it do
|
||||
should contain_package('fluent-plugin-elasticsearch').with({
|
||||
'ensure' => 'present',
|
||||
'provider' => 'fluentd_gem',
|
||||
'notify' => 'Class[Fluentd::Service]'
|
||||
})
|
||||
end
|
||||
end
|
||||
describe 'gem plugin' do
|
||||
let(:title) { 'fluent-plugin-elasticsearch' }
|
||||
let(:params) do
|
||||
{
|
||||
type: 'gem'
|
||||
}
|
||||
end
|
||||
|
||||
context 'file plugin' do
|
||||
let(:title) { 'fluent-plugin-test' }
|
||||
let(:params) do
|
||||
{
|
||||
type: 'file',
|
||||
source: 'puppet:///path/to/source'
|
||||
}
|
||||
end
|
||||
it do
|
||||
should contain_package('fluent-plugin-elasticsearch').with({
|
||||
'ensure' => 'present',
|
||||
'provider' => 'fluentd_gem',
|
||||
'notify' => 'Class[Fluentd::Service]'
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_file('/etc/td-agent/plugin/fluent-plugin-test').with({
|
||||
'ensure' => 'present',
|
||||
'owner' => 'td-agent',
|
||||
'group' => 'td-agent',
|
||||
'mode' => '0640',
|
||||
'source' => 'puppet:///path/to/source',
|
||||
'notify' => 'Class[Fluentd::Service]'
|
||||
})
|
||||
describe 'file plugin' do
|
||||
let(:title) { 'fluent-plugin-test' }
|
||||
let(:params) do
|
||||
{
|
||||
type: 'file',
|
||||
source: 'puppet:///path/to/source'
|
||||
}
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_file('/etc/td-agent/plugin/fluent-plugin-test').with({
|
||||
'ensure' => 'present',
|
||||
'owner' => 'td-agent',
|
||||
'group' => 'td-agent',
|
||||
'mode' => '0640',
|
||||
'source' => 'puppet:///path/to/source',
|
||||
'notify' => 'Class[Fluentd::Service]'
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@@ -1,39 +1,33 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::source' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
context 'basic source' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '10',
|
||||
config: {
|
||||
'type' => 'tail',
|
||||
'format' => 'json',
|
||||
'path' => '/var/log/test-application/*.json',
|
||||
'tag' => 'application.test'
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
|
||||
describe 'basic source' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '10',
|
||||
config: {
|
||||
'type' => 'tail',
|
||||
'format' => 'json',
|
||||
'path' => '/var/log/test-application/*.json',
|
||||
'tag' => 'application.test'
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
is_expected.to contain_file('/etc/td-agent/conf.d/10-source-test.conf').
|
||||
with_content(/<source>/).
|
||||
with_content(/type tail/).
|
||||
with_content(/format json/).
|
||||
with_content(/path \/var\/log\/test-application\/\*.json/).
|
||||
with_content(/tag application.test/).
|
||||
with_content(/<\/source>/)
|
||||
it do
|
||||
is_expected.to contain_file('/etc/td-agent/conf.d/10-source-test.conf').
|
||||
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/source_tail.conf')))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
6
spec/fixtures/files/filter_record_transformer.conf
vendored
Normal file
6
spec/fixtures/files/filter_record_transformer.conf
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<filter *.test>
|
||||
type record_transformer
|
||||
<record>
|
||||
hostname ${hostname}
|
||||
</record>
|
||||
</filter>
|
13
spec/fixtures/files/match_copy.conf
vendored
Normal file
13
spec/fixtures/files/match_copy.conf
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<match *.test>
|
||||
type copy
|
||||
<store>
|
||||
type elasticsearch
|
||||
logstashformat true
|
||||
hosts 172.20.10.17:9200
|
||||
flush_interval 30s
|
||||
</store>
|
||||
<store>
|
||||
type file
|
||||
path /tmp/td-agent-debug.log
|
||||
</store>
|
||||
</match>
|
11
spec/fixtures/files/match_secure_forward.conf
vendored
Normal file
11
spec/fixtures/files/match_secure_forward.conf
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<match *.test>
|
||||
flush_interval 30s
|
||||
type secure_forward
|
||||
secure yes
|
||||
shared_key my_shared_key
|
||||
self_hostname instance.test.com
|
||||
ca_cert_path /path/to/ca.cert
|
||||
<server>
|
||||
host test.server.com
|
||||
</server>
|
||||
</match>
|
6
spec/fixtures/files/source_tail.conf
vendored
Normal file
6
spec/fixtures/files/source_tail.conf
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<source>
|
||||
type tail
|
||||
format json
|
||||
path /var/log/test-application/*.json
|
||||
tag application.test
|
||||
</source>
|
@@ -1 +1,3 @@
|
||||
require 'puppetlabs_spec_helper/module_spec_helper'
|
||||
require 'rspec-puppet-facts'
|
||||
include RspecPuppetFacts
|
||||
|
@@ -1,13 +1,13 @@
|
||||
<filter <%= @pattern %>>
|
||||
<% @config.each do |key, val| -%>
|
||||
<%- if val.is_a?( Hash ) -%>
|
||||
<<%= key -%>>
|
||||
<%- val.each do |key, val| -%>
|
||||
<%= key -%> <%= val %>
|
||||
<%- end -%>
|
||||
</<%= key %>>
|
||||
<%- else -%>
|
||||
<%= key -%> <%= val %>
|
||||
<%- end -%>
|
||||
<%- if val.is_a?( Hash ) -%>
|
||||
<<%= key -%>>
|
||||
<%- val.each do |key2, val2| -%>
|
||||
<%= key2 -%> <%= val2 %>
|
||||
<%- end -%>
|
||||
</<%= key %>>
|
||||
<%- else -%>
|
||||
<%= key -%> <%= val %>
|
||||
<%- end -%>
|
||||
<% end -%>
|
||||
</filter>
|
||||
|
@@ -1,39 +1,39 @@
|
||||
<match <%= @pattern %>>
|
||||
<% @config.each do |key, val| -%>
|
||||
<%- if val.is_a?( Hash ) -%>
|
||||
<<%= key -%>>
|
||||
<%- val.each do |key, val| -%>
|
||||
<%= key -%> <%= val %>
|
||||
<%- end -%>
|
||||
</<%= key %>>
|
||||
<%- elsif val.is_a?( Array ) -%>
|
||||
<%- val.each do |k, v| -%>
|
||||
<<%= key -%>>
|
||||
<%- if k.is_a?( Hash ) -%>
|
||||
<%- k.each do |x, y| -%>
|
||||
<%- if y.is_a?( Array ) -%>
|
||||
<%- y.each do |a, b| -%>
|
||||
<<%= x -%>>
|
||||
<%- if a.is_a?( Hash ) -%>
|
||||
<%- a.each do |c, d| -%>
|
||||
<%= c -%> <%= d %>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<%= a -%> <%= b %>
|
||||
<%- end -%>
|
||||
</<%= x %>>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<%= x -%> <%= y %>
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<%= k -%> <%= v %>
|
||||
<%- end -%>
|
||||
</<%= key %>>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<%= key -%> <%= val %>
|
||||
<%- if val.is_a?( Hash ) -%>
|
||||
<<%= key -%>>
|
||||
<%- val.each do |key, val| -%>
|
||||
<%= key -%> <%= val %>
|
||||
<%- end -%>
|
||||
</<%= key %>>
|
||||
<%- elsif val.is_a?( Array ) -%>
|
||||
<%- val.each do |k, v| -%>
|
||||
<<%= key -%>>
|
||||
<%- if k.is_a?( Hash ) -%>
|
||||
<%- k.each do |x, y| -%>
|
||||
<%- if y.is_a?( Array ) -%>
|
||||
<%- y.each do |a, b| -%>
|
||||
<<%= x -%>>
|
||||
<%- if a.is_a?( Hash ) -%>
|
||||
<%- a.each do |c, d| -%>
|
||||
<%= c -%> <%= d %>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<%= a -%> <%= b %>
|
||||
<%- end -%>
|
||||
</<%= x %>>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<%= x -%> <%= y %>
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<%= k -%> <%= v %>
|
||||
<%- end -%>
|
||||
</<%= key %>>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<%= key -%> <%= val %>
|
||||
<%- end -%>
|
||||
<% end -%>
|
||||
</match>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<source>
|
||||
<% @config.each do |key, val| -%>
|
||||
<%= key -%> <%= val %>
|
||||
<%= key -%> <%= val %>
|
||||
<% end -%>
|
||||
</source>
|
||||
|
Reference in New Issue
Block a user