Add Gemfile and puppet 4 checks
In anticipation of puppet 4, start trying to deal with puppet 4 things that can be helpfully predicted by puppet lint plugins. Also fix lint errors caught by the puppet-lint-absolute_classname-check and puppet-lint-empty_string-check gems. This patch changes a scope.lookupvar function call to ruby instance variable in the jenkins-log-client.default.erb template. This is safe to do because the template is called in the log_processor::client class and the variable in question is within that scope. Change-Id: Ia7d6af8bc76a65e37f5dfd184e37855fe3b97046
This commit is contained in:
parent
07fb1781f2
commit
3a57b1fe30
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
Gemfile.lock
|
||||
.bundled_gems/
|
30
Gemfile
Normal file
30
Gemfile
Normal file
@ -0,0 +1,30 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'puppetlabs_spec_helper', :require => false
|
||||
|
||||
gem 'metadata-json-lint'
|
||||
# This is nice and all, but let's not worry about it until we've actually
|
||||
# got puppet 4.x sorted
|
||||
# gem 'puppet-lint-param-docs'
|
||||
gem 'puppet-lint-absolute_classname-check'
|
||||
gem 'puppet-lint-absolute_template_path'
|
||||
gem 'puppet-lint-trailing_newline-check'
|
||||
|
||||
# Puppet 4.x related lint checks
|
||||
gem 'puppet-lint-unquoted_string-check'
|
||||
gem 'puppet-lint-empty_string-check'
|
||||
gem 'puppet-lint-leading_zero-check'
|
||||
gem 'puppet-lint-variable_contains_upcase'
|
||||
gem 'puppet-lint-spaceship_operator_without_tag-check'
|
||||
gem 'puppet-lint-undef_in_function-check'
|
||||
|
||||
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
||||
gem 'puppet', puppetversion, :require => false
|
||||
else
|
||||
gem 'puppet', '~> 3.0', :require => false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# vim:ft=ruby
|
@ -17,7 +17,7 @@
|
||||
#
|
||||
class log_processor::client (
|
||||
$config_file,
|
||||
$statsd_host = '',
|
||||
$statsd_host = undef,
|
||||
) {
|
||||
|
||||
file { '/etc/logstash/jenkins-log-client.yaml':
|
||||
@ -57,7 +57,7 @@ class log_processor::client (
|
||||
require => File['/etc/init.d/jenkins-log-client'],
|
||||
}
|
||||
|
||||
include logrotate
|
||||
include ::logrotate
|
||||
logrotate::file { 'log-client-debug.log':
|
||||
log => '/var/log/logstash/log-client-debug.log',
|
||||
options => [
|
||||
|
@ -33,7 +33,7 @@ class log_processor (
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
include pip
|
||||
include ::pip
|
||||
package { 'gear':
|
||||
ensure => latest,
|
||||
provider => 'pip',
|
||||
|
@ -51,7 +51,7 @@ define log_processor::worker (
|
||||
],
|
||||
}
|
||||
|
||||
include logrotate
|
||||
include ::logrotate
|
||||
logrotate::file { "log-worker${suffix}-debug.log":
|
||||
log => "/var/log/logstash/log-worker${suffix}-debug.log",
|
||||
options => [
|
||||
|
@ -1,5 +1,5 @@
|
||||
<% if scope.lookupvar("log_processor::client::statsd_host") != "" %>
|
||||
export STATSD_HOST=<%= scope.lookupvar("log_processor::client::statsd_host") %>
|
||||
<% if @statsd_host != nil %>
|
||||
export STATSD_HOST=<%= @statsd_host %>
|
||||
export STATSD_PORT=8125
|
||||
export STATSD_PREFIX="logstash.geard"
|
||||
<% end %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user