Skip to content

Commit fdeb711

Browse files
author
Helen Campbell
committed
pdksync_heads/master-0-g34e3266
1 parent 59c5b46 commit fdeb711

19 files changed

+99
-166
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
/tmp/
2020
/vendor/
2121
/convert_report.txt
22+
/update_report.txt
2223
.DS_Store

.pdkignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.*.sw[op]
2+
.metadata
3+
.yardoc
4+
.yardwarns
5+
*.iml
6+
/.bundle/
7+
/.idea/
8+
/.vagrant/
9+
/coverage/
10+
/bin/
11+
/doc/
12+
/Gemfile.local
13+
/Gemfile.lock
14+
/junit/
15+
/log/
16+
/pkg/
17+
/spec/fixtures/manifests/
18+
/spec/fixtures/modules/
19+
/tmp/
20+
/vendor/
21+
/convert_report.txt
22+
/update_report.txt
23+
.DS_Store

.rubocop.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ AllCops:
88
Exclude:
99
- bin/*
1010
- ".vendor/**/*"
11-
- Gemfile
12-
- Rakefile
11+
- "**/Gemfile"
12+
- "**/Rakefile"
1313
- pkg/**/*
1414
- spec/fixtures/**/*
1515
- vendor/**/*
16+
- "**/Puppetfile"
17+
- "**/Vagrantfile"
18+
- "**/Guardfile"
1619
Metrics/LineLength:
1720
Description: People have wide screens, use them.
1821
Max: 200
@@ -66,6 +69,11 @@ Style/SymbolArray:
6669
inherit_from: ".rubocop_todo.yml"
6770
RSpec/MessageSpies:
6871
EnforcedStyle: receive
72+
Style/Documentation:
73+
Exclude:
74+
- lib/puppet/parser/functions/**/*
75+
Style/WordArray:
76+
EnforcedStyle: brackets
6977
Style/CollectionMethods:
7078
Enabled: true
7179
Style/MethodCalledOnDoEndBlock:

.travis.yml

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
---
2-
env:
3-
global:
4-
- PARALLEL_TEST_PROCESSORS=16 # reduce test parallelism to prevent overloading containers
52
sudo: false
63
dist: trusty
74
language: ruby
@@ -10,7 +7,6 @@ before_install:
107
- bundle -v
118
- rm -f Gemfile.lock
129
- gem update --system
13-
- gem update bundler
1410
- gem --version
1511
- bundle -v
1612
script:
@@ -19,38 +15,34 @@ bundler_args: --without system_tests
1915
rvm:
2016
- 2.4.1
2117
env:
22-
- PUPPET_GEM_VERSION="~> 5.0" CHECK=spec
18+
global:
19+
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
20+
- PARALLEL_TEST_PROCESSORS=16
2321
matrix:
2422
fast_finish: true
2523
include:
2624
-
2725
bundler_args:
2826
dist: trusty
29-
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7
27+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/centos-7
3028
rvm: 2.4.1
3129
script: bundle exec rake beaker
3230
services: docker
3331
sudo: required
3432
-
3533
bundler_args:
3634
dist: trusty
37-
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04
35+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/ubuntu-14.04
3836
rvm: 2.4.1
3937
script: bundle exec rake beaker
4038
services: docker
4139
sudo: required
4240
-
43-
env: CHECK=rubocop
44-
-
45-
env: CHECK="syntax lint"
46-
-
47-
env: CHECK=metadata_lint
48-
-
49-
env: CHECK=release_checks
41+
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
5042
-
51-
env: CHECK=spec
43+
env: CHECK=parallel_spec
5244
-
53-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=spec
45+
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
5446
rvm: 2.1.9
5547
branches:
5648
only:

.yardopts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--markup markdown

Gemfile

+7-55
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ group :development do
2828
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
2929
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
3030
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
31+
gem "json", '<= 2.0.4', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
3132
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
3233
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
3334
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
3435
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
35-
gem "puppet-blacksmith", '~> 3.4', require: false
36+
gem "puppet-blacksmith", '~> 3.4', require: false, platforms: [:ruby]
3637
end
3738
group :system_tests do
3839
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
@@ -49,73 +50,24 @@ puppet_type = gem_type(puppet_version)
4950
facter_version = ENV['FACTER_GEM_VERSION']
5051
hiera_version = ENV['HIERA_GEM_VERSION']
5152

52-
def puppet_older_than?(version)
53-
puppet_version = ENV['PUPPET_GEM_VERSION']
54-
!puppet_version.nil? &&
55-
Gem::Version.correct?(puppet_version) &&
56-
Gem::Requirement.new("< #{version}").satisfied_by?(Gem::Version.new(puppet_version.dup))
57-
end
58-
5953
gems = {}
6054

6155
gems['puppet'] = location_for(puppet_version)
6256

6357
# If facter or hiera versions have been specified via the environment
64-
# variables, use those versions. If not, and if the puppet version is < 3.5.0,
65-
# use known good versions of both for puppet < 3.5.0.
66-
if facter_version
67-
gems['facter'] = location_for(facter_version)
68-
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
69-
gems['facter'] = ['>= 1.6.11', '<= 1.7.5', require: false]
70-
end
71-
72-
if hiera_version
73-
gems['hiera'] = location_for(ENV['HIERA_GEM_VERSION'])
74-
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
75-
gems['hiera'] = ['>= 1.0.0', '<= 1.3.0', require: false]
76-
end
58+
# variables
7759

78-
if Gem.win_platform? && (puppet_type != :gem || puppet_older_than?('3.5.0'))
79-
# For Puppet gems < 3.5.0 (tested as far back as 3.0.0) on Windows
80-
if puppet_type == :gem
81-
gems['ffi'] = ['1.9.0', require: false]
82-
gems['minitar'] = ['0.5.4', require: false]
83-
gems['win32-eventlog'] = ['0.5.3', '<= 0.6.5', require: false]
84-
gems['win32-process'] = ['0.6.5', '<= 0.7.5', require: false]
85-
gems['win32-security'] = ['~> 0.1.2', '<= 0.2.5', require: false]
86-
gems['win32-service'] = ['0.7.2', '<= 0.8.8', require: false]
87-
else
88-
gems['ffi'] = ['~> 1.9.0', require: false]
89-
gems['minitar'] = ['~> 0.5.4', require: false]
90-
gems['win32-eventlog'] = ['~> 0.5', '<= 0.6.5', require: false]
91-
gems['win32-process'] = ['~> 0.6', '<= 0.7.5', require: false]
92-
gems['win32-security'] = ['~> 0.1', '<= 0.2.5', require: false]
93-
gems['win32-service'] = ['~> 0.7', '<= 0.8.8', require: false]
94-
end
95-
96-
gems['win32-dir'] = ['~> 0.3', '<= 0.4.9', require: false]
97-
98-
if RUBY_VERSION.start_with?('1.')
99-
gems['win32console'] = ['1.3.2', require: false]
100-
# sys-admin was removed in Puppet 3.7.0 and doesn't compile under Ruby 2.x
101-
gems['sys-admin'] = ['1.5.6', require: false]
102-
end
60+
gems['facter'] = location_for(facter_version) if facter_version
61+
gems['hiera'] = location_for(hiera_version) if hiera_version
10362

104-
# Puppet < 3.7.0 requires these.
105-
# Puppet >= 3.5.0 gem includes these as requirements.
106-
# The following versions are tested to work with 3.0.0 <= puppet < 3.7.0.
107-
gems['win32-api'] = ['1.4.8', require: false]
108-
gems['win32-taskscheduler'] = ['0.2.2', require: false]
109-
gems['windows-api'] = ['0.4.3', require: false]
110-
gems['windows-pr'] = ['1.2.3', require: false]
111-
elsif Gem.win_platform?
63+
if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
11264
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
11365
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
11466
gems['win32-dir'] = ['<= 0.4.9', require: false]
11567
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
11668
gems['win32-process'] = ['<= 0.7.5', require: false]
11769
gems['win32-security'] = ['<= 0.2.5', require: false]
118-
gems['win32-service'] = ['<= 0.8.8', require: false]
70+
gems['win32-service'] = ['0.8.8', require: false]
11971
end
12072

12173
gems.each do |gem_name, gem_params|

Rakefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
require 'puppetlabs_spec_helper/rake_tasks'
22
require 'puppet-syntax/tasks/puppet-syntax'
3-
require 'puppet_blacksmith/rake_tasks'
3+
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
44
require 'puppet-lint/tasks/puppet-lint'
5+
6+
PuppetLint.configuration.send('disable_relative')
7+

lib/facter/apache_version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Facter.add(:apache_version) do
2-
confine kernel: %w[FreeBSD Linux]
2+
confine kernel: ['FreeBSD', 'Linux']
33
setcode do
44
if Facter::Util::Resolution.which('apachectl')
55
apache_version = Facter::Util::Resolution.exec('apachectl -v 2>&1')

metadata.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
}
7979
],
8080
"description": "Module for Apache configuration",
81-
"pdk-version": "1.4.1",
82-
"template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git",
83-
"template-ref": "1.4.1-0-g52adbbb"
81+
"pdk-version": "1.5.0",
82+
"template-url": "https://github.com/puppetlabs/pdk-templates",
83+
"template-ref": "heads/master-0-g34e3266"
8484
}

spec/acceptance/vhost_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ class { 'apache': }
10391039
end
10401040
end
10411041

1042-
%w[access error].each do |logtype|
1042+
['access', 'error'].each do |logtype|
10431043
case logtype
10441044
when 'access'
10451045
logname = 'CustomLog'

spec/classes/apache_spec.rb

+7-68
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,7 @@
5959
)
6060
}
6161
# Assert that load files are placed and symlinked for these mods, but no conf file.
62-
%w[
63-
auth_basic
64-
authn_file
65-
authz_default
66-
authz_groupfile
67-
authz_host
68-
authz_user
69-
dav
70-
env
71-
].each do |modname|
62+
['auth_basic', 'authn_file', 'authz_default', 'authz_groupfile', 'authz_host', 'authz_user', 'dav', 'env'].each do |modname|
7263
it {
7364
is_expected.to contain_file("#{modname}.load").with(
7465
'path' => "/etc/apache2/mods-available/#{modname}.load",
@@ -138,16 +129,7 @@
138129
end
139130

140131
# Assert that both load files and conf files are placed and symlinked for these mods
141-
%w[
142-
alias
143-
autoindex
144-
dav_fs
145-
deflate
146-
dir
147-
mime
148-
negotiation
149-
setenvif
150-
].each do |modname|
132+
['alias', 'autoindex', 'dav_fs', 'deflate', 'dir', 'mime', 'negotiation', 'setenvif'].each do |modname|
151133
it {
152134
is_expected.to contain_file("#{modname}.load").with(
153135
'path' => "/etc/apache2/mods-available/#{modname}.load",
@@ -379,16 +361,7 @@
379361
end
380362

381363
# Assert that load files are placed for these mods, but no conf file.
382-
%w[
383-
auth_basic
384-
authn_file
385-
authz_default
386-
authz_groupfile
387-
authz_host
388-
authz_user
389-
dav
390-
env
391-
].each do |modname|
364+
['auth_basic', 'authn_file', 'authz_default', 'authz_groupfile', 'authz_host', 'authz_user', 'dav', 'env'].each do |modname|
392365
it {
393366
is_expected.to contain_file("#{modname}.load").with_path(
394367
"/etc/httpd/mod.d/#{modname}.load",
@@ -402,16 +375,7 @@
402375
end
403376

404377
# Assert that both load files and conf files are placed for these mods
405-
%w[
406-
alias
407-
autoindex
408-
dav_fs
409-
deflate
410-
dir
411-
mime
412-
negotiation
413-
setenvif
414-
].each do |modname|
378+
['alias', 'autoindex', 'dav_fs', 'deflate', 'dir', 'mime', 'negotiation', 'setenvif'].each do |modname|
415379
it {
416380
is_expected.to contain_file("#{modname}.load").with_path(
417381
"/etc/httpd/mod.d/#{modname}.load",
@@ -642,14 +606,7 @@
642606
end
643607
describe 'default mods custom' do
644608
let :params do
645-
{ default_mods: %w[
646-
info
647-
alias
648-
mime
649-
env
650-
setenv
651-
expires
652-
] }
609+
{ default_mods: ['info', 'alias', 'mime', 'env', 'setenv', 'expires'] }
653610
end
654611

655612
it { is_expected.to contain_apache__mod('authz_host') }
@@ -774,16 +731,7 @@
774731
)
775732
}
776733
# Assert that load files are placed for these mods, but no conf file.
777-
%w[
778-
auth_basic
779-
authn_core
780-
authn_file
781-
authz_groupfile
782-
authz_host
783-
authz_user
784-
dav
785-
env
786-
].each do |modname|
734+
['auth_basic', 'authn_core', 'authn_file', 'authz_groupfile', 'authz_host', 'authz_user', 'dav', 'env'].each do |modname|
787735
it {
788736
is_expected.to contain_file("#{modname}.load").with(
789737
'path' => "/usr/local/etc/apache24/Modules/#{modname}.load",
@@ -794,16 +742,7 @@
794742
end
795743

796744
# Assert that both load files and conf files are placed for these mods
797-
%w[
798-
alias
799-
autoindex
800-
dav_fs
801-
deflate
802-
dir
803-
mime
804-
negotiation
805-
setenvif
806-
].each do |modname|
745+
['alias', 'autoindex', 'dav_fs', 'deflate', 'dir', 'mime', 'negotiation', 'setenvif'].each do |modname|
807746
it {
808747
is_expected.to contain_file("#{modname}.load").with(
809748
'path' => "/usr/local/etc/apache24/Modules/#{modname}.load",

spec/classes/mod/dev_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
it_behaves_like 'a mod class, without including apache'
1111

1212
[
13-
%w[RedHat 6 Santiago Linux],
14-
%w[Debian 6 squeeze Linux],
15-
%w[FreeBSD 9 FreeBSD FreeBSD],
13+
['RedHat', '6', 'Santiago', 'Linux'],
14+
['Debian', '6', 'squeeze', 'Linux'],
15+
['FreeBSD', '9', 'FreeBSD', 'FreeBSD'],
1616
].each do |osfamily, operatingsystemrelease, lsbdistcodename, kernel|
1717
context "on a #{osfamily} OS" do
1818
let :facts do

spec/classes/mod/negotiation_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
context 'with language_priority parameter' do
4242
let :params do
43-
{ language_priority: %w[en es] }
43+
{ language_priority: ['en', 'es'] }
4444
end
4545

4646
it do

0 commit comments

Comments
 (0)