-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add class to configure generating certificates #449
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
} | ||
} |
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 | ||||||||||||||
Comment on lines
+15
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the subject is the class itself, you can use
Suggested change
|
||||||||||||||
|
||||||||||||||
it { should compile.with_all_deps } | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||||||||
|
||||||||||||||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simplify all of these since the parameters are local