Skip to content

Commit

Permalink
Merge pull request #51 from parthaa/cdn-ssl
Browse files Browse the repository at this point in the history
Fixes #8444 - Expose cdn_ssl_version as an installer
  • Loading branch information
parthaa committed Dec 10, 2014
2 parents 673865b + 250f956 commit d968091
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#
# $proxy_password:: Proxy password for authentication
#
# $cdn_ssl_version:: SSL version used to communicate with the CDN. Optional. Use SSLv23 or TLSv1
#
class katello (

$user = $katello::params::user,
Expand All @@ -51,6 +53,7 @@
$proxy_port = $katello::params::proxy_port,
$proxy_username = $katello::params::proxy_username,
$proxy_password = $katello::params::proxy_password,
$cdn_ssl_version = $katello::params::cdn_ssl_version,

) inherits katello::params {

Expand Down
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
$proxy_username = undef
$proxy_password = undef

# cdn ssl settings
$cdn_ssl_version = undef

# system settings
$user = 'foreman'
$group = 'foreman'
Expand Down
24 changes: 24 additions & 0 deletions spec/classes/katello_config_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'spec_helper'

describe 'katello::config' do
let :facts do
{
:concat_basedir => '/tmp',
:interfaces => '',
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
:operatingsystemrelease => '6.5',
}
end

context 'default config settings' do
let(:pre_condition) do
['include foreman','include certs']
end

it 'should NOT set the cdn-ssl-version' do
should_not contain_file('/etc/foreman/plugins/katello.yaml').
with_content(/cdn_ssl_version/)
end
end
end
13 changes: 13 additions & 0 deletions spec/classes/katello_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
it { should contain_class('katello::install') }
it { should contain_class('katello::config') }
it { should contain_class('katello::service') }

context 'on setting cdn-ssl-version' do
let :params do
{
"cdn_ssl_version" => 'TLSv1'
}
end

it 'should set up the cdn_ssl_version' do
should contain_file('/etc/foreman/plugins/katello.yaml').
with_content(/^\s*cdn_ssl_version:\s*TLSv1$/)
end
end
end

context 'on centos' do
Expand Down
3 changes: 3 additions & 0 deletions templates/katello.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

common:
app_mode: 'katello'
<%- if @cdn_ssl_version && !@cdn_ssl_version.strip.empty?-%>
cdn_ssl_version: <%= @cdn_ssl_version %>
<%- end -%>

warden: <%= scope.lookupvar("katello::params::auth_method") %>
ldap_roles: <%= scope.lookupvar("katello::params::ldap_roles") %>
Expand Down

0 comments on commit d968091

Please sign in to comment.