Skip to content

Commit 779781a

Browse files
committed
fix HAWTIO_ROLE[S] (on Artemis 2.39.0+)
1 parent da9c178 commit 779781a

2 files changed

Lines changed: 47 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Added
11+
* Add HAWTIO_ROLES to artemis profile (on 2.39.0 and later)
12+
13+
### Removed
14+
* Remove HAWTIO_ROLE from artemis profile (on 2.39.0 and later)
15+
816
## [v3.0.0] - 2025-08-12
917
WARNING: This release may contain breaking changes (see below).
1018

manifests/instance.pp

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@
362362
File["instance ${name} bootstrap.xml"],
363363
File["instance ${name} jolokia-access.xml"],
364364
File["instance ${name} login.config"],
365-
File_line["instance ${name} set HAWTIO_ROLE"],
366365
File_line["instance ${name} set JAVA_ARGS"],
367366
]
368367
$_service_require_pre = [
@@ -371,7 +370,6 @@
371370
File["instance ${name} bootstrap.xml"],
372371
File["instance ${name} jolokia-access.xml"],
373372
File["instance ${name} login.config"],
374-
File_line["instance ${name} set HAWTIO_ROLE"],
375373
File_line["instance ${name} set JAVA_ARGS"],
376374
]
377375

@@ -543,6 +541,45 @@
543541
}
544542
}
545543

544+
# Changes for Artemis 2.39.0 and later.
545+
if (versioncmp($activemq::version, '2.39.0') >= 0) {
546+
# Remove old HAWTIO role.
547+
file_line { "instance ${name} remove HAWTIO_ROLE":
548+
ensure => 'absent',
549+
path => $artemis_profile,
550+
match => '^HAWTIO_ROLE=',
551+
match_for_absence => true,
552+
require => [
553+
Exec["create instance ${name}"]
554+
],
555+
}
556+
# Configure HAWTIO roles.
557+
file_line { "instance ${name} set HAWTIO_ROLES":
558+
ensure => 'present',
559+
path => $artemis_profile,
560+
line => "HAWTIO_ROLES=\'${$activemq::hawtio_role}\'",
561+
match => '^HAWTIO_ROLES=',
562+
after => '^# Hawtio Properties',
563+
append_on_no_match => true,
564+
require => [
565+
Exec["create instance ${name}"]
566+
],
567+
}
568+
} else {
569+
# Configure HAWTIO role (legacy).
570+
file_line { "instance ${name} set HAWTIO_ROLE":
571+
ensure => 'present',
572+
path => $artemis_profile,
573+
line => "HAWTIO_ROLE=\'${$activemq::hawtio_role}\'",
574+
match => '^HAWTIO_ROLE=',
575+
append_on_no_match => false,
576+
require => [
577+
Exec["create instance ${name}"]
578+
],
579+
}
580+
}
581+
582+
# Changes for Artemis 2.42.0 and later.
546583
if (versioncmp($activemq::version, '2.42.0') >= 0) {
547584
# Remove obsolete variables from profile.
548585
file_line { "instance ${name} remove ARTEMIS_INSTANCE_URI":
@@ -574,18 +611,6 @@
574611
}
575612
}
576613

577-
# Configure HAWTIO role.
578-
file_line { "instance ${name} set HAWTIO_ROLE":
579-
ensure => 'present',
580-
path => $artemis_profile,
581-
line => "HAWTIO_ROLE=\'${$activemq::hawtio_role}\'",
582-
match => '^HAWTIO_ROLE=',
583-
append_on_no_match => false,
584-
require => [
585-
Exec["create instance ${name}"]
586-
],
587-
}
588-
589614
# Configure ARTEMIS_HOME.
590615
file_line { "instance ${name} set ARTEMIS_HOME":
591616
ensure => 'present',

0 commit comments

Comments
 (0)