-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add class to configure generating certificates
- Loading branch information
Showing
2 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Handles generating certificates | ||
# | ||
# === Parameters: | ||
# | ||
# $apache:: Generates certificates needed by Apache | ||
# | ||
# $foreman:: Generates certificates needed by Foreman | ||
# | ||
# $candlepin:: Generates certificates needed by Candlepin | ||
# | ||
# $foreman_proxy:: Generates certificates needed by Foreman Proxy | ||
# | ||
# $puppet:: Generates certificates needed by Puppet | ||
# | ||
class certs::generate ( | ||
Boolean $apache = false, | ||
Boolean $foreman = false, | ||
Boolean $candlepin = false, | ||
Boolean $foreman_proxy = false, | ||
Boolean $puppet = false, | ||
) { | ||
if $certs::generate::apache { | ||
include certs::apache | ||
} | ||
|
||
if $certs::generate::foreman { | ||
include certs::foreman | ||
} | ||
|
||
if $certs::generate::candlepin { | ||
include certs::candlepin | ||
} | ||
|
||
if $certs::generate::foreman_proxy { | ||
include certs::foreman_proxy | ||
} | ||
|
||
if $certs::generate::puppet { | ||
include certs::puppet | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
require 'spec_helper' | ||
|
||
describe 'certs::generate' do | ||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let :facts do | ||
os_facts | ||
end | ||
|
||
describe 'with default parameters' do | ||
it { should compile.with_all_deps } | ||
end | ||
|
||
describe 'with apache true' do | ||
let :pre_condition do | ||
"class {'certs::generate': apache => true,}" | ||
end | ||
|
||
it { should compile.with_all_deps } | ||
|
||
it do | ||
is_expected.to contain_class('certs::apache') | ||
end | ||
end | ||
|
||
describe 'with foreman true' do | ||
let :pre_condition do | ||
"class {'certs::generate': foreman => true,}" | ||
end | ||
|
||
it { should compile.with_all_deps } | ||
|
||
it do | ||
is_expected.to contain_class('certs::foreman') | ||
end | ||
end | ||
|
||
describe 'with candlepin true' do | ||
let :pre_condition do | ||
"class {'certs::generate': candlepin => true,}" | ||
end | ||
|
||
it { should compile.with_all_deps } | ||
|
||
it do | ||
is_expected.to contain_class('certs::candlepin') | ||
end | ||
end | ||
|
||
describe 'with foreman_proxy true' do | ||
let :pre_condition do | ||
"class {'certs::generate': foreman_proxy => true,}" | ||
end | ||
|
||
it { should compile.with_all_deps } | ||
|
||
it do | ||
is_expected.to contain_class('certs::foreman_proxy') | ||
end | ||
end | ||
|
||
describe 'with puppet true' do | ||
let :pre_condition do | ||
"class {'certs::generate': puppet => true,}" | ||
end | ||
|
||
it { should compile.with_all_deps } | ||
|
||
it do | ||
is_expected.to contain_class('certs::puppet') | ||
end | ||
end | ||
end | ||
end | ||
end |