Showing with 51 additions and 38 deletions.
  1. +3 −0 .fixtures.yml
  2. +4 −0 .rubocop.yml
  3. +6 −3 .travis.yml
  4. +9 −1 CHANGELOG.md
  5. +7 −15 Gemfile
  6. +8 −0 appveyor.yml
  7. +4 −4 metadata.json
  8. +9 −9 spec/defines/prospector_spec.rb
  9. +1 −6 templates/prospector.yml.erb
3 changes: 3 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
fixtures:
repositories:
yumrepo_core:
repo: "https://github.com/puppetlabs/puppetlabs-yumrepo_core.git"
puppet_version: ">= 6.0.0"
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
apt:
repo: "https://github.com/puppetlabs/puppetlabs-apt.git"
Expand Down
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ AllCops:
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/*
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand Down
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,28 @@ script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.4.4
- 2.5.0
env:
global:
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
matrix:
fast_finish: true
include:
-
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop" DEPLOY_TO_FORGE=yes
-
env: CHECK=parallel_spec
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.4
-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
rvm: 2.1.9
notifications:
email: false
deploy:
provider: puppetforge
user: "pcfens"
user: pcfens
password:
secure: "z1SbP/Hisr5k66XL/ACLsZ/fG7cCpwl8apjZzt/YciWizwReioU2EkLr5tvXdUC10aIH6H7XBdA9XwPqwXa81cIqcdIHlRMIbosMUGYaXcUm1xhctB3GvEDqsxFqdZSHYXax+IR6Wt507Eop+iU3S5pf/zJcp4uSKQVapCMoeVCEQYLRwllgeaqtEUZwqOUwPk31C4YZxwrzmgbIVyXmPrp3SDToXaQm4S4RkayOqHH2lYi8isz3IPPQvDZY5681TBpo35AbsIRbhiLzGlBHbgRaE2dz7J1Gs8MBGFyrtDaPtc9UpbgEmyxgmaPs3NIeZkmfVoosjt2AHRsoMZB7ntaPAQ20mk44ugMhxd5HX8t7QdLPiYQqgA3O4QfKraxPzdEjYVs9Pf7BBgY4JpGSOAD3dlWNK0U40MzKe74cj6dshg9SfIdyf3M3MmI0KIIvdKhpgl8mSIL8MCWjnYYNpQMQDFgyrXvePnkPVlt7zlBxn+LJFFx3VLGNfSWbKavITM/nrvjpFkQZ34mPHTtTUYnT6HVehtwPd5x6ILqYcppEeeiloa4uLWhW/vg0wAOdOBv2IALdAqRMC56ODPK33gFRkX+CclsegtOh2In407njbXXZBQrY5h3SXuEVxZcFhGVTxJIV29viuWFSm7VF0a7IUmEbVrM23bqeaM+aOgs="
on:
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ Changelog
=========

## Unreleased
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v3.3.1...HEAD)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v3.3.2...HEAD)

## [v3.3.2](https://github.com/pcfens/puppet-filebeat/tree/v3.3.2)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v3.3.1...v3.3.2)

- Produce valid YAML for prospectors [\#193](https://github.com/pcfens/puppet-filebeat/pull/193)
- Upgrade to PDK 1.7.1
- Add tests for Puppet 6
- Add Puppet 6 support to metadata

## [v3.3.1](https://github.com/pcfens/puppet-filebeat/tree/v3.3.1)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v3.3.0...v3.3.1)
Expand Down
22 changes: 7 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

def location_for(place_or_version, fake_version = nil)
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
else
[place_or_version, { require: false }]
end
end
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
file_url_regex = %r{\Afile:\/\/(?<path>.*)}

def gem_type(place_or_version)
if place_or_version =~ %r{\Agit[:@]}
:git
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
:file
if place_or_version && (git_url = place_or_version.match(git_url_regex))
[fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
else
:gem
[place_or_version, { require: false }]
end
end

Expand All @@ -36,7 +29,6 @@ group :development do
end

puppet_version = ENV['PUPPET_GEM_VERSION']
puppet_type = gem_type(puppet_version)
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']

Expand Down
8 changes: 8 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ environment:
PUPPET_GEM_VERSION: ~> 5.0
RUBY_VERSION: 24-x64
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 6.0
RUBY_VERSION: 25
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 6.0
RUBY_VERSION: 25-x64
CHECK: parallel_spec
matrix:
fast_finish: true
install:
Expand Down
8 changes: 4 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pcfens-filebeat",
"version": "3.3.1",
"version": "3.3.2",
"author": "pcfens",
"summary": "A module to install and manage the filebeat log shipper",
"license": "Apache-2.0",
Expand Down Expand Up @@ -93,7 +93,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.0.0 < 6.0.0"
"version_requirement": ">= 4.0.0 < 7.0.0"
}
],
"tags": [
Expand All @@ -102,7 +102,7 @@
"elasticsearch",
"elastic"
],
"pdk-version": "1.7.0",
"pdk-version": "1.7.1",
"template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git",
"template-ref": "1.7.0-0-g57412ed"
"template-ref": "1.7.1-0-g810b982"
}
18 changes: 9 additions & 9 deletions spec/defines/prospector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@
if os_facts[:kernel] != 'windows'
it { is_expected.to compile }
end
it {
is_expected.to contain_file('filebeat-docker').with(
notify: 'Service[filebeat]',
)
is_expected.to contain_file('filebeat-docker').with_content(
%r{- type: docker\n\s{2}containers:\n\s{4}ids:\n\s{4}- '\*'\n\s{4}path: /var/lib/docker/containers\n\s{4}stream: all\n\s{2}combine_partial: false\n\s{2}cri.parse_flags: false\n},
)
}
it {
is_expected.to contain_file('filebeat-docker').with(
notify: 'Service[filebeat]',
)
is_expected.to contain_file('filebeat-docker').with_content(
%r{- type: docker\n\s{2}containers:\n\s{4}ids:\n\s{4}- '\*'\n\s{4}path: /var/lib/docker/containers\n\s{4}stream: all\n\s{2}combine_partial: false\n\s{2}cri.parse_flags: false\n},
)
}
end
end
end
Expand Down
7 changes: 1 addition & 6 deletions templates/prospector.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,5 @@
<%- if @processors.length > 0 -%>
# Managing processors releated only for specified prospector
processors:
<%- @processors.each do |proc| -%>
- <%= proc.keys[0] %>:
<%- proc[proc.keys[0]].each do |k, v| -%>
<%= k %>: <%= v %>
<%- end -%>
<%- end -%>
<%- %><%= @processors.to_yaml.lines[1..-1].join.gsub(/^/, ' ') -%>
<%- end -%>