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 update #116

Merged
merged 2 commits into from
Mar 27, 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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ matrix:
# Only Puppet >= 4.4 supports Ruby 2.3. Also limit the OS set we test Ruby 2.3 with.
- rvm: 2.3.0
env: PUPPET_VERSION=4.4 ONLY_OS=redhat-7-x86_64,centos-7-x86_64
bundler_args: --without development
bundler_args: --without system_tests development
sudo: false
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '~> 3.5'
gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 3.5'

gem 'rake'
gem 'rspec', '~> 3.0'
Expand All @@ -21,10 +21,13 @@ gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-param-docs', '>= 1.3.0'
gem 'puppet-lint-strict_indent-check'
gem 'simplecov'
gem 'puppet-blacksmith', '>= 3.1.0', {"groups"=>["development"]}
gem 'json', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'json_pure', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'beaker-rspec', {"groups"=>["system_tests"]}
gem 'beaker-puppet_install_helper', {"groups"=>["system_tests"]}
gem 'metadata-json-lint'
gem 'kafo_module_lint'

Expand Down
9 changes: 2 additions & 7 deletions manifests/reverse_proxy.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#Adds http reverse-proxy to parent conf
class foreman_proxy_content::reverse_proxy (

$path = '/',
$url = "https://${foreman_proxy_content::parent_fqdn}/",
$port = $foreman_proxy_content::params::reverse_proxy_port

) {

) {
include ::apache

Class['certs::foreman_proxy'] ~>
Expand All @@ -15,9 +12,7 @@
port => $port,
docroot => '/var/www/',
priority => '28',
ssl_options => ['+StdEnvVars',
'+ExportCertData',
'+FakeBasicAuth'],
ssl_options => ['+StdEnvVars', '+ExportCertData', '+FakeBasicAuth'],
ssl => true,
ssl_proxyengine => true,
ssl_cert => $certs::apache::apache_cert,
Expand Down
20 changes: 20 additions & 0 deletions spec/acceptance/nodesets/docker/centos-6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/Katello/foreman-installer-modulesync
HOSTS:
centos-6-x64:
platform: el-6-x86_64
hypervisor: docker
image: centos:6
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'rm -rf /var/run/network/*'
- 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which'
- 'rm /etc/init/tty.conf'
CONFIG:
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
19 changes: 19 additions & 0 deletions spec/acceptance/nodesets/docker/centos-7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/Katello/foreman-installer-modulesync
HOSTS:
centos-7-x64:
platform: el-7-x86_64
hypervisor: docker
image: centos:7
docker_preserve_image: true
docker_cmd: '["/usr/sbin/init"]'
docker_image_commands:
- 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which ss'
- 'systemctl mask getty@tty1.service'
CONFIG:
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
30 changes: 24 additions & 6 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
require 'beaker/puppet_install_helper'

hosts.each do |host|
# Install Puppet
install_puppet
end
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'

RSpec.configure do |c|
# Project root
Expand All @@ -16,9 +14,29 @@
# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
puppet_module_install(:source => proj_root, :module_name => 'katello_devel')
puppet_module_install(:source => proj_root, :module_name => 'foreman_proxy_content')
hosts.each do |host|
on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
["puppetlabs-stdlib"].each do |mod|
on host, puppet('module', 'install', mod), { :acceptable_exit_codes => [0] }
end

if fact_on(host, 'osfamily') == 'RedHat'
# don't delete downloaded rpm for use with BEAKER_provision=no +
# BEAKER_destroy=no
on host, 'sed -i "s/keepcache=.*/keepcache=1/" /etc/yum.conf'
# refresh check if cache needs refresh on next yum command
on host, 'yum clean expire-cache'
end
end
end
end

shared_examples 'a idempotent resource' do
it 'applies with no errors' do
apply_manifest(pp, catch_failures: true)
end

it 'applies a second time without changes' do
apply_manifest(pp, catch_changes: true)
end
end