This repository was archived by the owner on Aug 29, 2018. It is now read-only.
forked from mojolingo/puppet-openshift
-
Notifications
You must be signed in to change notification settings - Fork 128
/
Copy pathmcollective_client.pp
102 lines (89 loc) · 3.76 KB
/
mcollective_client.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Copyright 2013 Mojo Lingo LLC.
# Modifications by Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
class openshift_origin::mcollective_client {
include openshift_origin::params
package { "${::openshift_origin::params::ruby_scl_prefix}mcollective-client":
alias => 'mcollective-client',
require => Class['openshift_origin::install_method'],
}
# TODO: Replace with MCollective puppet module call
$cluster_members = $::openshift_origin::real_msgserver_cluster_members
if $cluster_members {
$pool_size = size($cluster_members)
} else {
$pool_size = '1'
}
if ($::openshift_origin::msgserver_tls_enabled == 'enabled' or $::openshift_origin::msgserver_tls_enabled == 'strict') {
if ($::openshift_origin::msgserver_tls_ca != '') and ($::openshift_origin::msgserver_tls_key != '') and ($::openshift_origin::msgserver_tls_cert != '') {
$tls_certs_provided = true
file { 'mcollective client cert directory':
ensure => 'directory',
path => "${::openshift_origin::params::ruby_scl_path_prefix}/etc/mcollective/certs/",
owner => 'apache',
group => 'apache',
mode => '0750',
require => Package['mcollective-client','httpd'],
}
file { 'mcollective client tls ca':
ensure => 'present',
path => "${::openshift_origin::params::ruby_scl_path_prefix}/etc/mcollective/certs/ca.pem",
owner => 'apache',
group => 'apache',
mode => '0640',
source => $::openshift_origin::msgserver_tls_ca,
require => Package['mcollective-client','httpd'],
}
file { 'mcollective client tls cert':
ensure => 'present',
path => "${::openshift_origin::params::ruby_scl_path_prefix}/etc/mcollective/certs/cert.pem",
owner => 'apache',
group => 'apache',
mode => '0640',
source => $::openshift_origin::msgserver_tls_cert,
require => Package['mcollective-client','httpd'],
}
file { 'mcollective client tls key':
ensure => 'present',
path => "${::openshift_origin::params::ruby_scl_path_prefix}/etc/mcollective/certs/key.pem",
owner => 'apache',
group => 'apache',
mode => '0640',
source => $::openshift_origin::msgserver_tls_key,
require => Package['mcollective-client','httpd'],
}
} else { $tls_certs_provided = false }
}
if ($::openshift_origin::msgserver_tls_enabled == 'strict' and $tls_certs_provided == false) {
fail 'Valid certificate file locations are required when msgserver_tls_enabled is in strict mode.'
}
file { 'mcollective client config':
ensure => present,
path => "${::openshift_origin::params::ruby_scl_path_prefix}/etc/mcollective/client.cfg",
content => template('openshift_origin/mcollective/mcollective-client.cfg.erb'),
owner => 'apache',
group => 'apache',
mode => '0640',
require => Package['mcollective-client','httpd'],
}
file { 'mcollective log file':
ensure => present,
path => "/var/log/openshift/broker/${::openshift_origin::params::ruby_scl_prefix}mcollective-client.log",
owner => 'apache',
group => 'root',
mode => '0644',
require => Package['mcollective-client','httpd'],
}
}