File tree Expand file tree Collapse file tree 6 files changed +34
-6
lines changed Expand file tree Collapse file tree 6 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 5
5
6
6
file { $orchestrator::config :
7
7
ensure => file ,
8
- owner => 0 ,
9
- group => 0 ,
10
- mode => ' 0644 ' ,
8
+ owner => $orchestrator::service_user ,
9
+ group => $orchestrator::service_group ,
10
+ mode => ' 0640 ' ,
11
11
content => template ($orchestrator::config_template ),
12
12
}
13
13
}
Original file line number Diff line number Diff line change 24
24
# if true module willl manage service
25
25
# @param service_name
26
26
# service name to manage. Default 'orchestrator'
27
+ # @param service_user
28
+ # user to own the service. Default 'orchestrator'
29
+ # @param service_group
30
+ # group to own the service. Default 'orchestrator'
27
31
class orchestrator (
28
32
String $config = $orchestrator::params::config,
29
33
Hash[String[1], Any] $config_defaults = $orchestrator::params::config_defaults,
37
41
String $service_ensure = $orchestrator::params::service_ensure ,
38
42
Boolean $service_manage = $orchestrator::params::service_manage ,
39
43
String $service_name = $orchestrator::params::service_name ,
44
+ String $service_user = $orchestrator::params::service_user ,
45
+ String $service_group = $orchestrator::params::service_group ,
40
46
) inherits orchestrator::params {
41
47
validate_absolute_path($config )
42
48
validate_string($config_template )
Original file line number Diff line number Diff line change 3
3
$cnf_erb = ' orchestrator/orchestrator.cnf.erb'
4
4
5
5
file { $orchestrator::topology_cnf :
6
+ ensure => file ,
7
+ owner => $orchestrator::service_user ,
8
+ group => $orchestrator::service_group ,
9
+ mode => ' 0640' ,
6
10
content => template ($cnf_erb ),
7
- mode => ' 0644' ,
8
11
}
9
12
file { $orchestrator::srv_cnf :
13
+ ensure => file ,
14
+ owner => $orchestrator::service_user ,
15
+ group => $orchestrator::service_group ,
16
+ mode => ' 0640' ,
10
17
content => template ($cnf_erb ),
11
- mode => ' 0644' ,
12
18
}
13
19
}
Original file line number Diff line number Diff line change 10
10
$service_ensure = ' running'
11
11
$service_manage = true
12
12
$service_name = ' orchestrator'
13
+ $service_user = ' root'
14
+ $service_group = ' root'
13
15
$srv_cnf = ' /etc/orchestrator_srv.cnf'
14
16
$topology_cnf = ' /etc/orchestrator.cnf'
15
17
Original file line number Diff line number Diff line change 5
5
}
6
6
7
7
if $orchestrator::service_manage == true {
8
+ if ' systemd' in $facts [' init_systems' ] {
9
+ include systemd
10
+
11
+ systemd::manage_dropin { '10_user.conf' :
12
+ ensure => ' present' ,
13
+ unit => ' orchestrator.service' ,
14
+ service_entry => {
15
+ ' User' => $orchestrator::service_user ,
16
+ ' Group' => $orchestrator::service_group ,
17
+ },
18
+ }
19
+ }
20
+
8
21
service { 'orchestrator' :
9
22
ensure => $orchestrator::service_ensure ,
10
23
enable => $orchestrator::service_enable ,
Original file line number Diff line number Diff line change 57
57
],
58
58
"dependencies" : [
59
59
{ "name" : " puppetlabs/stdlib" , "version_requirement" : " >= 3.2.0 <5.0.0" },
60
- { "name" : " computology/packagecloud" , "version_requirement" : " >= 0.2.0" }
60
+ { "name" : " computology/packagecloud" , "version_requirement" : " >= 0.2.0" },
61
+ { "name" : " voxpupuli/systemd" , "version_requirement" : " >= 4.1.0" }
61
62
]
62
63
}
You can’t perform that action at this time.
0 commit comments