File tree Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 74
74
}
75
75
76
76
if $foreman::manage_user {
77
+ if $foreman::puppet_ssldir in $foreman::server_ssl_key or $foreman::puppet_ssldir in $foreman::client_ssl_key {
78
+ $_user_groups = $foreman::user_groups + [' puppet' ]
79
+ } else {
80
+ $_user_groups = $foreman::user_groups
81
+ }
82
+
77
83
group { $foreman::group :
78
84
ensure => ' present' ,
79
85
}
83
89
comment => ' Foreman' ,
84
90
home => $foreman::app_root ,
85
91
gid => $foreman::group ,
86
- groups => $foreman::user_groups ,
92
+ groups => unique($_user_groups) ,
87
93
}
88
94
}
89
95
Original file line number Diff line number Diff line change 24
24
$manage_user = true
25
25
$user = ' foreman'
26
26
$group = ' foreman'
27
- $user_groups = [' puppet ' ]
27
+ $user_groups = []
28
28
$rails_env = ' production'
29
29
$version = ' present'
30
30
$plugin_version = ' present'
Original file line number Diff line number Diff line change @@ -5,4 +5,6 @@ foreman::server_ssl_cert: /etc/foreman-certs/certificate.pem
5
5
foreman::server_ssl_chain : /etc/foreman-certs/certificate.pem
6
6
foreman::server_ssl_crl : " "
7
7
foreman::server_ssl_key : /etc/foreman-certs/key.pem
8
- foreman::user_groups : []
8
+ foreman::client_ssl_ca : /etc/foreman-certs/certificate.pem
9
+ foreman::client_ssl_cert : /etc/foreman-certs/certificate.pem
10
+ foreman::client_ssl_key : /etc/foreman-certs/key.pem
Original file line number Diff line number Diff line change 409
409
it { should_not contain_class ( 'redis::instance' ) }
410
410
end
411
411
end
412
+
413
+ describe 'with non-Puppet SSL certificates' do
414
+ let ( :params ) do
415
+ super ( ) . merge (
416
+ server_ssl_key : '/etc/pki/localhost.key' ,
417
+ server_ssl_cert : '/etc/pki/localhost.crt' ,
418
+ client_ssl_key : '/etc/pki/localhost.key' ,
419
+ client_ssl_cert : '/etc/pki/localhost.crt' ,
420
+ )
421
+ end
422
+
423
+ it { should contain_user ( 'foreman' ) . with ( 'groups' => [ ] ) }
424
+ end
412
425
end
413
426
end
414
427
end
You can’t perform that action at this time.
0 commit comments