summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gemfile14
-rw-r--r--.gitignore3
-rw-r--r--.travis.yml36
-rw-r--r--Gemfile14
-rw-r--r--README.md15
-rw-r--r--manifests/imfile.pp2
-rw-r--r--manifests/init.pp2
-rw-r--r--manifests/server.pp2
-rw-r--r--spec/fixtures/.gitignore3
-rw-r--r--spec/fixtures/manifests/site.pp3
-rw-r--r--templates/database.conf.erb6
-rw-r--r--templates/imfile.erb12
12 files changed, 70 insertions, 42 deletions
diff --git a/.gemfile b/.gemfile
new file mode 100644
index 0000000..e9e1270
--- /dev/null
+++ b/.gemfile
@@ -0,0 +1,14 @@
+source 'https://rubygems.org'
+
+group :development, :test do
+ gem 'rake', :require => false
+ gem 'puppet-lint', :require => false
+ gem 'rspec-puppet', :require => false
+ gem 'puppetlabs_spec_helper', :require => false
+end
+
+if puppetversion = ENV['PUPPET_GEM_VERSION']
+ gem 'puppet', puppetversion, :require => false
+else
+ gem 'puppet', :require => false
+end
diff --git a/.gitignore b/.gitignore
index 6ee20c2..1dd271e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
pkg/
*.swp
+/metadata.json
+.forge-releng
+/spec/fixtures
diff --git a/.travis.yml b/.travis.yml
index 6d7c0f8..0f0d59d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,15 +1,35 @@
+---
+branches:
+ only:
+ - master
language: ruby
+bundler_args: --without development
+script: bundle exec rake spec SPEC_OPTS='--format documentation'
+after_success:
+ - git clone -q git://github.com/puppetlabs/ghpublisher.git .forge-releng
+ - .forge-releng/publish
rvm:
- 1.8.7
- 1.9.3
- - 2.0.0
- - ruby-head
env:
- - PUPPET_GEM_VERSION=">= 3.0.0"
+ matrix:
+ - PUPPET_GEM_VERSION="~> 2.7.0"
+ - PUPPET_GEM_VERSION="~> 3.0.0"
+ - PUPPET_GEM_VERSION="~> 3.1.0"
+ - PUPPET_GEM_VERSION="~> 3.2.0"
+ - PUPPET_GEM_VERSION="~> 3.3.0"
+ global:
+ - PUBLISHER_LOGIN=saz
+ - secure: |-
+ EmipIx5A93xnHKwdHfuMPGNLjLz0M0wND0IyeucWhIHE+KtZ48oT+mO2XhnJSpu1DH
+ JaSoYgjQpCILvniWg76o+HY1bTDEP3AmUlxNFgfDAOAQfv0RHv2cEcgNxNrxsddx6S
+ Ks0FCvVkFgY703X+kBiYTpjP4SBzRe0y9OudSvk=
matrix:
- allow_failures:
- - rvm: 2.0.0
- - rvm: ruby-head
include:
- - rvm: 1.8.7
- env: PUPPET_GEM_VERSION="~> 2.7"
+ - rvm: 2.0.0
+ env: PUPPET_GEM_VERSION="~> 3.2.0"
+ - rvm: 2.0.0
+ env: PUPPET_GEM_VERSION="~> 3.3.0"
+notifications:
+ email: false
+gemfile: .gemfile
diff --git a/Gemfile b/Gemfile
deleted file mode 100644
index a89043b..0000000
--- a/Gemfile
+++ /dev/null
@@ -1,14 +0,0 @@
-source :rubygems
-
-if ENV.key?('PUPPET_VERSION')
- puppetversion = "= #{ENV['PUPPET_VERSION']}"
-else
- puppetversion = ['>= 2.7']
-end
-
-gem 'rake'
-gem 'puppet-lint'
-gem 'rspec-puppet'
-gem 'puppet', puppetversion
-gem 'puppetlabs_spec_helper', '>= 0.4.0'
-
diff --git a/README.md b/README.md
index d2e2dd5..e40405a 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,15 @@ Manage rsyslog client and server via Puppet
port => '514',
}
```
+for read from file
+```
+ rsyslog::imfile { 'my-imfile':
+ file_name => '/some/file',
+ file_tag => 'mytag',
+ file_facility => 'myfacility',
+ }
+
+```
#### Logging to a MySQL or PostgreSQL database
@@ -106,9 +115,9 @@ Due to a missing feature in current RELP versions (InputRELPServerBindRuleset op
remote logging is using TCP. You can switch between TCP and UDP. As soon as there is
a new RELP version which supports setting Rulesets, I will add support for relp back.
-By default, rsyslog::server will strip numbers from hostnames. This means the logs of
-multiple servers with the same non-numerical name will be aggregrated in a single
+By default, rsyslog::server will strip numbers from hostnames. This means the logs of
+multiple servers with the same non-numerical name will be aggregrated in a single
directory. i.e. www01 www02 and www02 would all log to the www directory.
-To log each host to a seperate directory, set the custom_config parameter to
+To log each host to a seperate directory, set the custom_config parameter to
'rsyslog/server-hostname.conf.erb'
diff --git a/manifests/imfile.pp b/manifests/imfile.pp
index 5127a5c..a6e8216 100644
--- a/manifests/imfile.pp
+++ b/manifests/imfile.pp
@@ -30,6 +30,8 @@ define rsyslog::imfile(
$run_file_monitor = true
) {
+ include rsyslog
+
file { "${rsyslog::rsyslog_d}${name}.conf":
ensure => file,
owner => 'root',
diff --git a/manifests/init.pp b/manifests/init.pp
index 2c91e09..05b9943 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -30,7 +30,7 @@ class rsyslog (
$spool_dir = $rsyslog::params::spool_dir,
$service_name = $rsyslog::params::service_name,
$client_conf = $rsyslog::params::client_conf,
- $server_conf = $rsyslog::params::server_conf,
+ $server_conf = $rsyslog::params::server_conf
) inherits rsyslog::params {
class { 'rsyslog::install': }
class { 'rsyslog::config': }
diff --git a/manifests/server.pp b/manifests/server.pp
index f1f3260..ef0525a 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -29,7 +29,7 @@ class rsyslog::server (
$enable_tcp = true,
$enable_udp = true,
$enable_onefile = false,
- $server_dir = '/srv/log',
+ $server_dir = '/srv/log/',
$custom_config = undef,
$high_precision_timestamps = false
) inherits rsyslog {
diff --git a/spec/fixtures/.gitignore b/spec/fixtures/.gitignore
deleted file mode 100644
index a4e73f9..0000000
--- a/spec/fixtures/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*
-!manifests/site.pp
-!.gitignore
diff --git a/spec/fixtures/manifests/site.pp b/spec/fixtures/manifests/site.pp
deleted file mode 100644
index 56d4561..0000000
--- a/spec/fixtures/manifests/site.pp
+++ /dev/null
@@ -1,3 +0,0 @@
-node default {
- include ::rsyslog
-}
diff --git a/templates/database.conf.erb b/templates/database.conf.erb
index 174cef2..3934d6c 100644
--- a/templates/database.conf.erb
+++ b/templates/database.conf.erb
@@ -1,6 +1,6 @@
# File is managed by Puppet
-## Configuration file for rsyslog-<%= backend %>
+## Configuration file for rsyslog-<%= @backend %>
-$ModLoad <%= db_module %>
-*.* :<%= db_module -%>:<%= server -%>,<%= database -%>,<%= username -%>,<%= password %>
+$ModLoad <%= @db_module %>
+*.* :<%= @db_module -%>:<%= @server -%>,<%= @database -%>,<%= @username -%>,<%= @password %>
diff --git a/templates/imfile.erb b/templates/imfile.erb
index 31d3ec2..0540158 100644
--- a/templates/imfile.erb
+++ b/templates/imfile.erb
@@ -1,11 +1,11 @@
$ModLoad imfile
-$InputFileName <%= file_name %>
-$InputFileTag <%= file_tag %>
-$InputFileStateFile state-<%= name %>
-$InputFileSeverity <%= file_severity %>
-$InputFileFacility <%= file_facility %>
-$InputFilePollInterval <%= polling_interval %>
+$InputFileName <%= @file_name %>
+$InputFileTag <%= @file_tag %>
+$InputFileStateFile state-<%= @name %>
+$InputFileSeverity <%= @file_severity %>
+$InputFileFacility <%= @file_facility %>
+$InputFilePollInterval <%= @polling_interval %>
<% if run_file_monitor == true -%>
$InputRunFileMonitor
<% end -%>