Skip to content

Commit 22240e1

Browse files
authored
Merge pull request #424 from paychex/dev
CentOS Acceptance testing, and more....
2 parents f726ea9 + ae76b60 commit 22240e1

7 files changed

Lines changed: 77 additions & 32 deletions

File tree

.overcommit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ PrePush:
5858
enabled: true
5959
description: 'Run rake targets'
6060
targets:
61+
- 'validate'
6162
- 'test'
6263
- 'rubocop'
6364
command: [ 'bundle', 'exec', 'rake' ]

.sync.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
---
22
.travis.yml:
3-
secret: "D0l5n9nSaR4BTQ/fB95EWk0CuiSjLCaYDo6W5hesyaehBACbQqexEGBW2XLRlAIGz4QHgA6z87gu1Y7FMuot7xJXqgur4NU4pbrdzjz/gLuVPRxxWEmAp68yBwkwO2QoC3ISfzgRJjOMlTfAjM7dROpAoRPuNDMFGdAoC259ggA="
3+
secret: "bBDDSSz8OQwK0zxJ4EjM01bE4uoNMzTXyxp2lllXdv6PYAJCI4bCCcdRF7OKLAWaRtm6c0HJGnfMXzmwqHF/pJSUZzfTGe4uwZrrmaGvdalP4fXtLWpviAoez8La0Nx7JYqwPPprP7nySBD8M3rUuOZJetXQM6yGgj4YSs2lKMo="
4+
docker_sets:
5+
- set: ubuntu1404-64
6+
- set: ubuntu1604-64
7+
- set: debian8-64
8+
- set: debian9-64
9+
- set: centos7-64

.travis.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,36 @@ matrix:
2525
- rvm: 2.5.1
2626
bundler_args: --without system_tests development release
2727
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
28+
- rvm: 2.5.1
29+
bundler_args: --without development release
30+
dist: trusty
31+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
32+
services: docker
33+
sudo: required
34+
- rvm: 2.5.1
35+
bundler_args: --without development release
36+
dist: trusty
37+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
38+
services: docker
39+
sudo: required
40+
- rvm: 2.5.1
41+
bundler_args: --without development release
42+
dist: trusty
43+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
44+
services: docker
45+
sudo: required
46+
- rvm: 2.5.1
47+
bundler_args: --without development release
48+
dist: trusty
49+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} CHECK=beaker
50+
services: docker
51+
sudo: required
52+
- rvm: 2.5.1
53+
bundler_args: --without development release
54+
dist: trusty
55+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
56+
services: docker
57+
sudo: required
2858
branches:
2959
only:
3060
- master
@@ -40,7 +70,7 @@ deploy:
4070
provider: puppetforge
4171
user: puppet
4272
password:
43-
secure: ""
73+
secure: "bBDDSSz8OQwK0zxJ4EjM01bE4uoNMzTXyxp2lllXdv6PYAJCI4bCCcdRF7OKLAWaRtm6c0HJGnfMXzmwqHF/pJSUZzfTGe4uwZrrmaGvdalP4fXtLWpviAoez8La0Nx7JYqwPPprP7nySBD8M3rUuOZJetXQM6yGgj4YSs2lKMo="
4474
on:
4575
tags: true
4676
# all_branches is required to use tags

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This module has been tested to work on the following systems.
1919
* Debian 9
2020
* EL 6
2121
* EL 7
22+
* CentOS 7
2223
* Gentoo (and Sabayon)
2324
* Suse 11
2425
* Ubuntu 14.04

manifests/install.pp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@
2828
'Gentoo' => undef,
2929
}
3030

31-
$dev_ensure = $python::dev ? {
32-
true => 'present',
33-
false => 'absent',
34-
default => $python::dev,
35-
}
36-
3731
$pip_ensure = $python::pip ? {
3832
true => 'present',
3933
false => 'absent',
@@ -46,6 +40,21 @@
4640
default => $python::virtualenv,
4741
}
4842

43+
if $venv_ensure == 'present' {
44+
$dev_ensure = 'present'
45+
unless $python::dev {
46+
# Error: python2-devel is needed by (installed) python-virtualenv-15.1.0-2.el7.noarch
47+
# Python dev is required for virtual environment, but python environment is not required for python dev.
48+
notify { 'Python virtual environment is dependent on python dev': }
49+
}
50+
} else {
51+
$dev_ensure = $python::dev ? {
52+
true => 'present',
53+
false => 'absent',
54+
default => $python::dev,
55+
}
56+
}
57+
4958
package { 'python':
5059
ensure => $python::ensure,
5160
name => $python,
@@ -96,6 +105,7 @@
96105
Package <| title == 'virtualenv' |> {
97106
name => 'virtualenv',
98107
provider => 'pip',
108+
require => Package['python-dev']
99109
}
100110
}
101111
'scl': {

spec/classes/python_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@
3131
end
3232
end
3333

34+
describe 'with python::virtualenv, without python::dev' do
35+
context 'true' do
36+
let(:params) { { dev: 'absent', virtualenv: 'present' } }
37+
38+
it { is_expected.to contain_package('python-dev').with_ensure('present') }
39+
end
40+
context 'empty/default' do
41+
it { is_expected.to contain_package('python-dev').with_ensure('absent') }
42+
end
43+
end
44+
3445
describe 'with manage_gunicorn' do
3546
context 'true' do
3647
let(:params) { { manage_gunicorn: true } }

spec/spec_helper_acceptance.rb

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,19 @@
11
require 'beaker-rspec'
2+
require 'beaker-puppet'
3+
require 'beaker/puppet_install_helper'
4+
require 'beaker/module_install_helper'
25

3-
UNSUPPORTED_PLATFORMS = ['windows'].freeze
4-
5-
unless ENV['RS_PROVISION'] == 'no' || ENV['BEAKER_provision'] == 'no'
6-
hosts.each do |host|
7-
if host.is_pe?
8-
install_pe
9-
else
10-
install_puppet
11-
end
12-
end
13-
end
6+
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
7+
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
8+
install_module_on(hosts)
9+
install_module_dependencies_on(hosts)
1410

1511
RSpec.configure do |c|
16-
# Project root
17-
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
18-
1912
# Readable test descriptions
2013
c.formatter = :documentation
21-
22-
# Configure all nodes in nodeset
23-
c.before :suite do
24-
# Install module and dependencies
25-
hosts.each do |host|
26-
shell('rm -rf /etc/puppet/modules/python/')
27-
copy_module_to(host, source: proj_root, module_name: 'python')
28-
shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
29-
on host, puppet('module install puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
30-
on host, puppet('module install stahnma-epel'), acceptable_exit_codes: [0, 1]
14+
hosts.each do |host|
15+
if host[:platform] =~ %r{el-7-x86_64} && host[:hypervisor] =~ %r{docker}
16+
on(host, "sed -i '/nodocs/d' /etc/yum.conf")
3117
end
3218
end
3319
end

0 commit comments

Comments
 (0)