Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit aaa134b

Browse files
committed
Add system_user and system_group parameters to params.pp.
Set them for debian and the rest of the world to "activemq", but for OpenBSD default to the package user/group "_activemq" Allow the parameter to be overridden in the init.pp, and push the values, and make use of it to config.pp.
1 parent 8ec2655 commit aaa134b

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

manifests/config.pp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
$server_config,
1515
$instance,
1616
$package,
17+
$system_user,
18+
$system_group,
1719
$path = '/etc/activemq/activemq.xml',
1820
$server_config_show_diff = 'UNSET',
1921
) {
2022

2123
# Resource defaults
2224
File {
23-
owner => 'activemq',
24-
group => 'activemq',
25+
owner => $system_user,
26+
group => $system_group,
2527
mode => '0644',
2628
notify => Service['activemq'],
2729
require => Package[$package],
@@ -59,8 +61,8 @@
5961
file { 'activemq.xml':
6062
ensure => file,
6163
path => $path_real,
62-
owner => 'activemq',
63-
group => 'activemq',
64+
owner => $system_user,
65+
group => $system_group,
6466
mode => '0600',
6567
content => $server_config_real,
6668
}

manifests/init.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
$webconsole = $activemq::params::webconsole,
3333
$server_config = $activemq::params::server_config,
3434
$server_config_show_diff = $activemq::params::server_config,
35+
$system_user = $activemq::params::system_user,
36+
$system_group = $activemq::params::system_group,
3537
$mq_broker_name = $activemq::params::mq_broker_name,
3638
$mq_admin_username = $activemq::params::mq_admin_username,
3739
$mq_admin_password = $activemq::params::mq_admin_password,
@@ -94,6 +96,8 @@
9496
package => $package_real,
9597
server_config => $server_config_real,
9698
server_config_show_diff => $server_config_show_diff,
99+
system_user => $system_user,
100+
system_group => $system_group,
97101
require => Class['activemq::packages'],
98102
notify => Class['activemq::service'],
99103
}

manifests/params.pp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,22 @@
1515
$mq_cluster_brokers = []
1616

1717
# Debian does not include the webconsole
18+
# OpenBSD system user/group differs
1819
case $::osfamily {
1920
'Debian': {
20-
$webconsole = false
21+
$webconsole = false
22+
$system_user = 'activemq'
23+
$system_group = 'activemq'
24+
}
25+
'OpenBSD': {
26+
$webconsole = true
27+
$system_user = '_activemq'
28+
$system_group = '_activemq'
2129
}
2230
default: {
23-
$webconsole = true
31+
$webconsole = true
32+
$system_user = 'activemq'
33+
$system_group = 'activemq'
2434
}
2535
}
2636
}

0 commit comments

Comments
 (0)