From 4b309e9987c63cea053b477aa6861103e9c513fc Mon Sep 17 00:00:00 2001 From: Mike Terzo Date: Tue, 21 Mar 2017 17:47:21 -0400 Subject: [PATCH 1/3] Basic test coverage for apache::vhost --- .fixtures.yml | 2 ++ spec/classes/vhost_spec.rb | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 spec/classes/vhost_spec.rb diff --git a/.fixtures.yml b/.fixtures.yml index 955ce0cb..ca4ebdb3 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,8 +1,10 @@ fixtures: repositories: stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git" + concat: "git://github.com/puppetlabs/puppetlabs-concat.git" vcsrepo: "git://github.com/puppetlabs/puppetlabs-vcsrepo.git" python: "git://github.com/stankevich/puppet-python.git" epel: "git://github.com/stahnma/puppet-module-epel.git" + apache: 'git://github.com/puppetlabs/puppetlabs-apache.git' symlinks: puppetboard: "#{source_dir}" diff --git a/spec/classes/vhost_spec.rb b/spec/classes/vhost_spec.rb new file mode 100644 index 00000000..3b6fb971 --- /dev/null +++ b/spec/classes/vhost_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' + +describe 'puppetboard::apache::vhost' do + describe 'default params' do + let :params do + { + 'vhost_name' => 'puppetboard.local', + 'port' => 80 + } + end + let(:pre_condition) do + [ + 'class { "apache": default_vhost => false, default_mods => false, vhost_enable_dir => "/etc/apache2/sites-enabled"}', + 'class { "apache::mod::wsgi": }' + ] + end + on_supported_os.each do |os, facts| + let :facts do + facts + end + context "on #{os}" do + it { is_expected.to contain_class('puppetboard::apache::vhost') } + it { is_expected.to contain_file('/srv/puppetboard/puppetboard/wsgi.py') } + it do + is_expected.to contain_apache__vhost('puppetboard.local').with( + 'ensure' => 'present', + 'port' => 80 + ).that_requires('File[/srv/puppetboard/puppetboard/wsgi.py]') + end + it do + is_expected.to contain_concat('25-puppetboard.local.conf').with( + 'ensure' => 'present', + 'path' => '/etc/apache2/sites-available/25-puppetboard.local.conf' + ) + end + end + end + end +end From 6cff9d3222604d1485a2e0de0933a6fb94a9179e Mon Sep 17 00:00:00 2001 From: Mike Terzo Date: Tue, 21 Mar 2017 17:53:51 -0400 Subject: [PATCH 2/3] Note that oracle linux has a problem with a pip provider for a couple versions of puppet --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 6802aaaf..c8e180cc 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,9 @@ Installation Dependencies ------------ +Note Oracle linux 5 on puppet versions 4.6.0 to 4.7.1 has pip package problem +which will cause an error trying to install puppetboard. + Note that this module no longer explicitly requires the puppetlabs apache module. If you want to use the apache functionality of this module you will have to specify that the apache module is installed with: From f63a2d4178b8ea5b999a8314ef082fada2d324a6 Mon Sep 17 00:00:00 2001 From: Mike Terzo Date: Tue, 21 Mar 2017 17:54:18 -0400 Subject: [PATCH 3/3] Add a docs section about disabling SELinux --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index c8e180cc..309c0e76 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,16 @@ class { 'puppetboard': } ``` + +Disable SELinux +----- +```puppet +class { 'puppetboard': + manage_selinux => false, +} +``` + + ### Apache If you want puppetboard accessible through Apache and you're able to use the