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

CentOS Acceptance testing, and more.... #424

Merged
merged 8 commits into from
Aug 19, 2018
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
1 change: 1 addition & 0 deletions .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ PrePush:
enabled: true
description: 'Run rake targets'
targets:
- 'validate'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- 'test'
- 'rubocop'
command: [ 'bundle', 'exec', 'rake' ]
8 changes: 7 additions & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
.travis.yml:
secret: "D0l5n9nSaR4BTQ/fB95EWk0CuiSjLCaYDo6W5hesyaehBACbQqexEGBW2XLRlAIGz4QHgA6z87gu1Y7FMuot7xJXqgur4NU4pbrdzjz/gLuVPRxxWEmAp68yBwkwO2QoC3ISfzgRJjOMlTfAjM7dROpAoRPuNDMFGdAoC259ggA="
secret: "bBDDSSz8OQwK0zxJ4EjM01bE4uoNMzTXyxp2lllXdv6PYAJCI4bCCcdRF7OKLAWaRtm6c0HJGnfMXzmwqHF/pJSUZzfTGe4uwZrrmaGvdalP4fXtLWpviAoez8La0Nx7JYqwPPprP7nySBD8M3rUuOZJetXQM6yGgj4YSs2lKMo="
docker_sets:
- set: ubuntu1404-64
- set: ubuntu1604-64
- set: debian8-64
- set: debian9-64
- set: centos7-64
32 changes: 31 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,36 @@ matrix:
- rvm: 2.5.1
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
branches:
only:
- master
Expand All @@ -40,7 +70,7 @@ deploy:
provider: puppetforge
user: puppet
password:
secure: ""
secure: "bBDDSSz8OQwK0zxJ4EjM01bE4uoNMzTXyxp2lllXdv6PYAJCI4bCCcdRF7OKLAWaRtm6c0HJGnfMXzmwqHF/pJSUZzfTGe4uwZrrmaGvdalP4fXtLWpviAoez8La0Nx7JYqwPPprP7nySBD8M3rUuOZJetXQM6yGgj4YSs2lKMo="
on:
tags: true
# all_branches is required to use tags
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This module has been tested to work on the following systems.
* Debian 9
* EL 6
* EL 7
* CentOS 7
* Gentoo (and Sabayon)
* Suse 11
* Ubuntu 14.04
Expand Down
22 changes: 16 additions & 6 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
'Gentoo' => undef,
}

$dev_ensure = $python::dev ? {
true => 'present',
false => 'absent',
default => $python::dev,
}

$pip_ensure = $python::pip ? {
true => 'present',
false => 'absent',
Expand All @@ -46,6 +40,21 @@
default => $python::virtualenv,
}

if $venv_ensure == 'present' {
$dev_ensure = 'present'
unless $python::dev {
# Error: python2-devel is needed by (installed) python-virtualenv-15.1.0-2.el7.noarch
# Python dev is required for virtual environment, but python environment is not required for python dev.
notify { 'Python virtual environment is dependent on python dev': }
}
} else {
$dev_ensure = $python::dev ? {
true => 'present',
false => 'absent',
default => $python::dev,
}
}

package { 'python':
ensure => $python::ensure,
name => $python,
Expand Down Expand Up @@ -96,6 +105,7 @@
Package <| title == 'virtualenv' |> {
name => 'virtualenv',
provider => 'pip',
require => Package['python-dev']
}
}
'scl': {
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
end
end

describe 'with python::virtualenv, without python::dev' do
context 'true' do
let(:params) { { dev: 'absent', virtualenv: 'present' } }

it { is_expected.to contain_package('python-dev').with_ensure('present') }
end
context 'empty/default' do
it { is_expected.to contain_package('python-dev').with_ensure('absent') }
end
end

describe 'with manage_gunicorn' do
context 'true' do
let(:params) { { manage_gunicorn: true } }
Expand Down
34 changes: 10 additions & 24 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
require 'beaker-rspec'
require 'beaker-puppet'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'

UNSUPPORTED_PLATFORMS = ['windows'].freeze

unless ENV['RS_PROVISION'] == 'no' || ENV['BEAKER_provision'] == 'no'
hosts.each do |host|
if host.is_pe?
install_pe
else
install_puppet
end
end
end
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
install_module_on(hosts)
install_module_dependencies_on(hosts)

RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))

# Readable test descriptions
c.formatter = :documentation

# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
hosts.each do |host|
shell('rm -rf /etc/puppet/modules/python/')
copy_module_to(host, source: proj_root, module_name: 'python')
shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
on host, puppet('module install puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
on host, puppet('module install stahnma-epel'), acceptable_exit_codes: [0, 1]
hosts.each do |host|
if host[:platform] =~ %r{el-7-x86_64} && host[:hypervisor] =~ %r{docker}
on(host, "sed -i '/nodocs/d' /etc/yum.conf")
end
end
end