diff --git a/REFERENCE.md b/REFERENCE.md index 1f39a51..46c7250 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -430,10 +430,12 @@ Default value: ``undef`` ##### `ha_policy` -Data type: `Enum['live-only','replication','shared-storage']` +Data type: `Optional[Enum['live-only','replication','shared-storage']]` ActiveMQ Artemis HA policy. +Default value: ``undef`` + ##### `initial_replication_sync_timeout` Data type: `Integer` diff --git a/manifests/instance.pp b/manifests/instance.pp index 6bbf291..a6932df 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -135,7 +135,6 @@ Hash[String[1], Hash] $connectors, Array $discovery_groups, Boolean $failover_on_shutdown, - Enum['live-only','replication','shared-storage'] $ha_policy, Integer $initial_replication_sync_timeout, Integer $journal_buffer_timeout, Boolean $journal_datasync, @@ -162,6 +161,7 @@ Optional[Boolean] $service_enable = undef, Optional[Enum['running','stopped']] $service_ensure = undef, Optional[String] $target_host = undef, + Optional[Enum['live-only','replication','shared-storage']] $ha_policy, # TODO: broker-plugins (nothing set by default, but it should be supported) ) { File { diff --git a/templates/broker.xml.epp b/templates/broker.xml.epp index 26529db..adc4ea1 100644 --- a/templates/broker.xml.epp +++ b/templates/broker.xml.epp @@ -157,33 +157,37 @@ under the License. +<% if $ha_policy { -%> <<%= $ha_policy %>> +<% if $ha_policy == 'replication' or $ha_policy == 'shared-storage' { -%> <<%= $role %>> -<% if !empty($group) { -%> +<% if !empty($group) { -%> <%= $group %> -<% } -%> +<% } -%> <%= $activemq::cluster_name %> -<% if $ha_policy == 'replication' { -%> +<% if $ha_policy == 'replication' { -%> <%= $initial_replication_sync_timeout %> -<% if $check_for_live_server and $role == 'master' { -%> +<% if $check_for_live_server and $role == 'master' { -%> true -<% } -%> -<% if $vote_on_replication_failure and $role == 'master' { -%> +<% } -%> +<% if $vote_on_replication_failure and $role == 'master' { -%> true -<% } -%> -<% } -%> -<% if $ha_policy == 'shared-storage' { -%> -<% if $failover_on_shutdown and $role == 'master' { -%> +<% } -%> +<% } -%> +<% if $ha_policy == 'shared-storage' { -%> +<% if $failover_on_shutdown and $role == 'master' { -%> true -<% } -%> -<% } -%> -<% if $allow_failback and $role == 'slave' { -%> +<% } -%> +<% } -%> +<% if $allow_failback and $role == 'slave' { -%> true -<% } -%> +<% } -%> > +<% } -%> > +<% } -%> <% } -%> <% if (('enable' in $security) and ($security['enable'] == true)) { -%>