Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modulesync 0.21.3 #55

Merged
merged 4 commits into from
Jun 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,7 @@ If you don't want to have to recreate the virtual machine every time you
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
for the created virtual machines will be in `.vagrant/beaker_vagrant_fies`.

The easiest way to debug in a docker container is to open a shell:

docker exec -it -u root ${container_id_or_name} bash
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Puppetfile.lock
*.iml
.*.sw?
.yardoc/
Guardfile
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '0.20.1'
modulesync_config_version: '0.21.3'
63 changes: 63 additions & 0 deletions .overcommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Managed by https://github.com/voxpupuli/modulesync_configs
#
# Hooks are only enabled if you take action.
#
# To enable the hooks run:
#
# ```
# bundle exec overcommit --install
# # ensure .overcommit.yml does not harm to you and then
# bundle exec overcommit --sign
# ```
#
# (it will manage the .git/hooks directory):
#
# Examples howto skip a test for a commit or push:
#
# ```
# SKIP=RuboCop git commit
# SKIP=PuppetLint git commit
# SKIP=RakeTask git push
# ```
#
# Don't invoke overcommit at all:
#
# ```
# OVERCOMMIT_DISABLE=1 git commit
# ```
#
# Read more about overcommit: https://github.com/brigade/overcommit
#
# To manage this config yourself in your module add
#
# ```
# .overcommit.yml:
# unmanaged: true
# ```
#
# to your modules .sync.yml config
---
PreCommit:
RuboCop:
enabled: true
description: 'Runs rubocop on modified files only'
command: ['bundle', 'exec', 'rubocop']
PuppetLint:
enabled: true
description: 'Runs puppet-lint on modified files only'
command: ['bundle', 'exec', 'puppet-lint']
YamlSyntax:
enabled: true
JsonSyntax:
enabled: true
TrailingWhitespace:
enabled: true

PrePush:
RakeTarget:
enabled: true
description: 'Run rake targets'
targets:
- 'test'
- 'rubocop'
command: [ 'bundle', 'exec', 'rake' ]
1 change: 1 addition & 0 deletions .rspec_parallel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--format progress
11 changes: 11 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ AllCops:
- .vendor/**/*
- pkg/**/*
- spec/fixtures/**/*
- Gemfile
- Rakefile
- Guardfile
Lint/ConditionPosition:
Enabled: True

Expand Down Expand Up @@ -500,6 +503,10 @@ Style/ClosingParenthesisIndentation:

# RSpec

RSpec/BeforeAfterAll:
Exclude:
- spec/acceptance/**/*

# We don't use rspec in this way
RSpec/DescribeClass:
Enabled: False
Expand All @@ -519,6 +526,10 @@ RSpec/RepeatedDescription:
RSpec/NestedGroups:
Enabled: False

# this is broken on ruby1.9
Style/IndentHeredoc:
Enabled: False

# disable Yaml safe_load. This is needed to support ruby2.0.0 development envs
Security/YAMLLoad:
Enabled: false
29 changes: 18 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sudo: false
dist: trusty
language: ruby
cache: bundler
bundler_args: --without system_tests development
before_install:
- bundle -v
- rm Gemfile.lock || true
Expand All @@ -17,33 +16,41 @@ matrix:
fast_finish: true
include:
- rvm: 2.1.9
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.2.6
- rvm: 2.2.7
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.3.3
- rvm: 2.3.4
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.4.0
- rvm: 2.4.1
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.4.0
- rvm: 2.4.1
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=rubocop
- rvm: 2.4.0
- rvm: 2.4.1
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.4.0
bundler_args: --without development
dist: trusty
env: PUPPET_INSTALL_TYPE=agent CHECK=acceptance BEAKER_debug=true BEAKER_set=docker/centos-7
services: docker
sudo: required
bundler_args: --without development
- rvm: 2.4.0
bundler_args: --without development
dist: trusty
env: PUPPET_INSTALL_TYPE=agent CHECK=acceptance BEAKER_debug=true BEAKER_set=docker/debian-8
services: docker
sudo: required
bundler_args: --without development
- rvm: 2.4.0
bundler_args: --without development
dist: trusty
env: PUPPET_INSTALL_TYPE=agent CHECK=acceptance BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04
services: docker
sudo: required
bundler_args: --without development

branches:
only:
- master
Expand All @@ -54,7 +61,7 @@ deploy:
provider: puppetforge
user: puppet
password:
secure: "MARQfvJecdPQz1JCbXHasx7SmB2lxD7MqDLzSQ48Ky8wleh01brkvuN+v3OCtBTvuyGDK+QYvQD6ZH7+5Vs6LwlyMTeQm0qP8THskMJtlHKILpc+MvRKleNBoXnAlWjG/Owul1S10Tq7x7LfeQfAaG3k+l7qz+JMh/C7dAylwLv/hCjFr7WJ7pohKfA6+8tZxGRhcJDImKdQcp7N/iTaKopD3mXq9Swsy/WePa36jFIU9IsCHGmwJSxiQ+g79ybY5o81Or2MC4Xc4G7de5bWdFZg6r2aFqGXICetHYimVCHvEhmpGT6JfFMb+E/7hVAHHIBgwzHEKr6NHhZhJaebvjDx9BPtH+FsbRq1G0mMHRd72iHPptjXL36bMpmf+CmJJ2gjyMEgigqE/73+iqsfePjoj0yQdERRaZLE4rVDO7M/LHU1z8PP4OUVzDp1RuwTAPUO1IjpP/+gMxpSRrbAyWwkeWe+Cey3Z6YsEOmt6kyXVW8OdPTyg6C1Zk3YSOLZ5TpF7Uhad4Gyz8BGfz/ovxDuNC1hcenOJgANMRfglE8eFvYjjFo8mYD4KxydvvMTTt1V3j5nWlRrWQM8l9ZgOe7vtXFX4qGR35XDW6wyyDAWFzF3GkrZdbn/WBTaOiL+TsOFWJqqCT9W4rENVhGWhMGSvMVriMevrClvIoIHIPI="
secure: ""
on:
tags: true
# all_branches is required to use tags
Expand Down
17 changes: 9 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '~> 2.0.1', :require => false
gem 'parallel_tests', :require => false
gem 'puppetlabs_spec_helper', '~> 2.1.1', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
Expand All @@ -26,22 +25,24 @@ group :test do
gem 'metadata-json-lint', :require => false
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git'
gem 'puppet-strings', '~> 1.0.0', :require => false
gem 'puppet-strings', '~> 1.0', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.47.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.10.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop', '~> 0.48.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'mocha', '>= 1.2.1', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'github_changelog_generator', '~> 1.13.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
gem 'parallel_tests', :require => false
end

group :development do
gem 'travis', :require => false
gem 'travis-lint', :require => false
gem 'guard-rake', :require => false
gem 'travis', :require => false
gem 'travis-lint', :require => false
gem 'guard-rake', :require => false
gem 'overcommit', '~> 0.39.1', :require => false
end

group :system_tests do
Expand Down
13 changes: 13 additions & 0 deletions spec/acceptance/nodesets/archlinux-2-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
archlinux-2-x64:
roles:
- master
platform: archlinux-2-x64
box: archlinux/archlinux
hypervisor: vagrant
CONFIG:
type: foss
2 changes: 1 addition & 1 deletion spec/acceptance/nodesets/docker/ubuntu-16.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ HOSTS:
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'apt-get install -y net-tools wget'
- 'apt-get install -y net-tools wget locales'
- 'locale-gen en_US.UTF-8'
CONFIG:
trace_limit: 200
Expand Down
15 changes: 15 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
let(:facts) do
facts
end

context 'with defaults for all parameters' do
it { is_expected.to contain_class('squid') }
it { is_expected.to contain_class('squid::install') }
Expand Down Expand Up @@ -81,6 +82,7 @@
workers: 8
}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_header').with_content(%r{^cache_mem\s+1024 MB$}) }
it { is_expected.to contain_concat_fragment('squid_header').with_content(%r{^memory_cache_shared\s+on$}) }
Expand All @@ -104,6 +106,7 @@
}
}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_order('10-07-urlregex') }
it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_content(%r{^acl\s+myacl\s+urlregex\shttp://example.org/$}) }
Expand All @@ -128,6 +131,7 @@
}
}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_order('10-07-urlregex') }
it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_content(%r{^acl\s+myacl\s+urlregex\shttp://example.org/$}) }
Expand All @@ -150,6 +154,7 @@
}
}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_http_access_this and that').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_http_access_this and that').with_order('20-08-deny') }
Expand All @@ -176,6 +181,7 @@

}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_http_access_this and that').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_http_access_this and that').with_order('20-08-deny') }
Expand All @@ -200,6 +206,7 @@
}
}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_ssl_bump_bump_step1').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_ssl_bump_bump_step1').with_order('25-08-bump') }
Expand All @@ -219,6 +226,7 @@
}
}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_sslproxy_cert_error_allow_all').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_sslproxy_cert_error_allow_all').with_order('35-08-allow') }
Expand All @@ -238,6 +246,7 @@
}
}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_icp_access_this and that').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_icp_access_this and that').with_order('30-08-deny') }
Expand All @@ -263,6 +272,7 @@

}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_icp_access_this and that').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_icp_access_this and that').with_order('30-08-deny') }
Expand All @@ -277,6 +287,7 @@
{ config: '/tmp/squid.conf',
http_ports: { 2000 => { 'options' => 'special for 2000' } } }
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_http_port_2000').with_order('30-05') }
it { is_expected.to contain_concat_fragment('squid_http_port_2000').with_content(%r{^http_port\s+2000\s+special for 2000$}) }
Expand All @@ -287,6 +298,7 @@
{ config: '/tmp/squid.conf',
https_ports: { 2001 => { 'options' => 'special for 2001' } } }
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_https_port_2001').with_order('30-05') }
it { is_expected.to contain_concat_fragment('squid_https_port_2001').with_content(%r{^https_port\s+2001\s+special for 2001$}) }
Expand All @@ -298,6 +310,7 @@
snmp_ports: { 2000 => { 'options' => 'special for 2000',
'process_number' => 3 } } }
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_snmp_port_2000').with_content(%r{^snmp_port\s+2000\s+special for 2000$}) }
it { is_expected.to contain_concat_fragment('squid_snmp_port_2000').with_content(%r{^if \${process_number} = 3$}) }
Expand All @@ -310,6 +323,7 @@
cache_dirs: { '/data' => { 'type' => 'special',
'options' => 'my options for special type' } } }
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_file('/data').with_ensure('directory') }
end
Expand All @@ -335,6 +349,7 @@
}
}
end

it { is_expected.to contain_concat_fragment('squid_header').with_target('/tmp/squid.conf') }
it { is_expected.to contain_squid__extra_config_section('mail settings') }
it { is_expected.to contain_squid__extra_config_section('other settings') }
Expand Down
2 changes: 2 additions & 0 deletions spec/defines/acl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'
end
let(:title) { 'myacl' }

context 'when parameters are set' do
let(:params) do
{
Expand All @@ -22,6 +23,7 @@
comment: 'Example company website'
}
end

it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_order('10-07-urlregex') }
it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_content(%r{^acl\s+myacl\s+urlregex\shttp://example.org/$}) }
Expand Down
2 changes: 2 additions & 0 deletions spec/defines/auth_param_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'
end
let(:title) { 'auth' }

context 'when parameters are set' do
entries = ['program /usr/lib64/squid/basic_ncsa_auth /etc/squid/.htpasswd',
'children 5',
Expand All @@ -26,6 +27,7 @@
entries: entries
}
end

it { is_expected.to contain_concat__fragment('squid_auth_param_auth').with_target('/tmp/squid.conf') }
it { is_expected.to contain_concat__fragment('squid_auth_param_auth').with_order('05-07-basic') }
entries.each do |entry|
Expand Down
Loading