From 693f3ce152998c4f32878475d4ccb3240c8b1ed2 Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Thu, 10 Mar 2016 11:20:07 -0500 Subject: [PATCH] Allow specifying custom fragment on httpd module --- manifests/apache/fragment.pp | 20 +++++++++++++++ spec/defines/pulp_apache_fragment_spec.rb | 30 +++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 manifests/apache/fragment.pp create mode 100644 spec/defines/pulp_apache_fragment_spec.rb diff --git a/manifests/apache/fragment.pp b/manifests/apache/fragment.pp new file mode 100644 index 00000000..ec285f34 --- /dev/null +++ b/manifests/apache/fragment.pp @@ -0,0 +1,20 @@ +# provides the ability to specify fragments for the ssl +# virtual host defined for a Pulp server +# +# === Parameters: +# +# $ssl_content:: content of the ssl virtual host fragment +define pulp::apache::fragment( + $ssl_content, + $order = 15, +) { + + validate_string($ssl_content) + + concat::fragment { $name: + target => '05-pulp-https.conf', + content => $ssl_content, + order => $order, + } + +} diff --git a/spec/defines/pulp_apache_fragment_spec.rb b/spec/defines/pulp_apache_fragment_spec.rb new file mode 100644 index 00000000..67091e09 --- /dev/null +++ b/spec/defines/pulp_apache_fragment_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +describe 'pulp::apache::fragment' do + let(:title) { 'fragment_title' } + + context 'on redhat' do + let :facts do + { + :concat_basedir => '/tmp', + :operatingsystem => 'RedHat', + :operatingsystemrelease => '6.4', + :operatingsystemmajrelease => '6.4', + :osreleasemajor => '6', + :osfamily => 'RedHat', + :processorcount => 3, + } + end + + context 'with ssl_content parameter' do + let :params do + { :ssl_content => "some_string" } + end + + it do + should contain_concat__fragment("fragment_title").with_content('some_string') + end + end + + end +end