Skip to content

Commit aba8e66

Browse files
committed
Split generate and deploy config into separate classes
1 parent 7baf230 commit aba8e66

File tree

8 files changed

+24
-12
lines changed

8 files changed

+24
-12
lines changed

manifests/apache.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
}
121121

122122
if $deploy {
123+
include certs::config::deploy
124+
123125
certs::keypair { $apache_cert_name:
124126
source_dir => "${certs::ssl_build_dir}/${hostname}",
125127
key_file => $apache_key,

manifests/ca.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
}
6161

6262
if $deploy {
63+
include certs::config::deploy
64+
6365
file { $certs::katello_default_ca_cert:
6466
ensure => file,
6567
source => $default_ca_path,

manifests/config.pp renamed to manifests/config/deploy.pp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
# @summary Basic directory structure
1+
# @summary Directory structure for certificates deployed into the pki_dir
22
# @api private
3-
class certs::config (
3+
class certs::config::deploy (
44
Stdlib::Absolutepath $pki_dir = $certs::pki_dir,
55
String $group = $certs::group,
66
) {
7-
file { $certs::ssl_build_dir:
8-
ensure => directory,
9-
owner => 'root',
10-
group => 'root',
11-
mode => '0700',
12-
}
13-
147
file { $pki_dir:
158
ensure => directory,
169
owner => 'root',

manifests/config/generate.pp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# @summary Basic directory structure for certificate generation
2+
# @api private
3+
class certs::config::generate (
4+
) {
5+
file { $certs::ssl_build_dir:
6+
ensure => directory,
7+
owner => 'root',
8+
group => 'root',
9+
mode => '0700',
10+
}
11+
}

manifests/foreman_proxy.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
}
108108

109109
if $deploy {
110+
include certs::config::deploy
111+
110112
certs::keypair { $proxy_cert_name:
111113
source_dir => "${certs::ssl_build_dir}/${hostname}",
112114
key_file => $proxy_key,

manifests/init.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@
115115
}
116116

117117
contain certs::install
118-
contain certs::config
118+
contain certs::config::generate
119119
contain certs::ca
120120

121121
Class['certs::install'] ->
122-
Class['certs::config'] ->
122+
Class['certs::config::generate'] ->
123123
Class['certs::ca']
124124

125125
$default_ca = Ca[$default_ca_name]

manifests/puppet.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
}
4040

4141
if $deploy {
42+
include certs::config::deploy
43+
4244
file { "${pki_dir}/puppet":
4345
ensure => directory,
4446
owner => $owner,

spec/classes/certs_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
end
99

1010
it { should contain_class('certs::install') }
11-
it { should contain_class('certs::config') }
11+
it { should contain_class('certs::config::generate') }
1212
end
1313
end
1414
end

0 commit comments

Comments
 (0)