Skip to content

Commit

Permalink
Merge pull request #31 from rh-messaging-qe/mt_fixversions
Browse files Browse the repository at this point in the history
New template 2.37.0 and support old HA style replication definition
  • Loading branch information
michalxo authored Sep 26, 2024
2 parents bea43c7 + 47d8f07 commit 5031780
Show file tree
Hide file tree
Showing 56 changed files with 1,414 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
{% endif %}
{% if user_ha.policy is defined and user_ha.policy == 'replication' %}
- policy: replication
{% if user_ha.role is defined and user_ha.role == 'master' %}
{% include 'artemis/_modules/broker_xml/ha_policy/replication/master.yaml.jinja2' %}
{% elif user_ha.role == 'slave' %}
{% include 'artemis/_modules/broker_xml/ha_policy/replication/slave.yaml.jinja2' %}
{% endif %}
{% if user_ha.role is defined and user_ha.role == 'primary' %}
role: primary
{% if user_ha.properties is defined %}
Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.21.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis
template: artemis-2.26

broker_xml:
name: '{{ broker_name }}'
Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.28.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.29.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis/
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.30.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis/
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.31.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis/
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.31.2.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis/
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.32.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis/
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.33.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis/
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
Expand Down
3 changes: 1 addition & 2 deletions profiles/artemis/claire-default-profile-2.34.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis/
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
max_disk_usage: 95

{% include 'artemis/_modules/broker_xml/journal/user_journal.yaml.jinja2' %}

Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.35.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis/
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
Expand Down
2 changes: 1 addition & 1 deletion profiles/artemis/claire-default-profile-2.36.0.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _defaults:
render:
generator_notice: true
licenses: true
template: artemis/
template: artemis-2.36

broker_xml:
name: '{{ broker_name }}'
Expand Down
Empty file.
10 changes: 10 additions & 0 deletions templates/artemis-2.36/artemis-roles.properties.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{# Jinja 2 template for Artemis etc/artemis-roles.properties #}
{% include 'libs/headers/properties_headers.jinja2' %}

# ---------------------------------------------------------------------------
{% include 'libs/licenses/apache-2.0/properties.jinja2' %}
# ---------------------------------------------------------------------------

{% for role, users in artemis_roles.items() %}
{{ role }} = {{ users|join(',') }}
{% endfor %}
10 changes: 10 additions & 0 deletions templates/artemis-2.36/artemis-users.properties.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{# Jinja 2 template for Artemis etc/artemis-data.properties #}
{% include 'libs/headers/properties_headers.jinja2' %}

# ---------------------------------------------------------------------------
{% include 'libs/licenses/apache-2.0/properties.jinja2' %}
# ---------------------------------------------------------------------------

{% for username, password in artemis_users.items() -%}
{{ username }} = {{ password }}
{% endfor %}
56 changes: 56 additions & 0 deletions templates/artemis-2.36/artemis.profile.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% include 'libs/headers/properties_headers.jinja2' %}

# ---------------------------------------------------------------------------
{% include 'libs/licenses/apache-2.0/properties.jinja2' %}
# ---------------------------------------------------------------------------

{% if artemis_profile.home is defined %}
ARTEMIS_HOME='{{ artemis_profile.home }}'
{% endif %}
{% if artemis_profile.instance is defined %}
ARTEMIS_INSTANCE='{{ artemis_profile.instance }}'
{% endif %}
{% if artemis_profile.data_dir is defined %}
ARTEMIS_DATA_DIR='{{ artemis_profile.data_dir }}'
{% endif %}
{% if artemis_profile.etc_dir is defined %}
ARTEMIS_ETC_DIR='{{ artemis_profile.etc_dir }}'
{% endif %}
{% if artemis_profile.oome_dump is defined %}
ARTEMIS_OOME_DUMP='{{ artemis_profile.instance }}/log/oom_dump.hprof'
{% endif %}

{% if artemis_profile.instance_uri is defined or artemis_profile.instance_etc_uri is defined %}
{% if artemis_profile.instance_uri is defined %}
ARTEMIS_INSTANCE_URI='{{ artemis_profile.instance_uri }}'
{% endif %}
{% if artemis_profile.instance_etc_uri is defined %}
ARTEMIS_INSTANCE_ETC_URI='{{ artemis_profile.instance_etc_uri }}'
{% endif %}
{% endif %}

{% if artemis_profile.cluster_properties is defined %}
# Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
ARTEMIS_CLUSTER_PROPS="{{ artemis_profile.cluster_properties|join(' ') }}"
{% endif %}

{% if artemis_profile.hawtio_roles is defined %}
HAWTIO_ROLE='{{ artemis_profile.hawtio_roles|join(',') }}'
{% endif %}

{% if artemis_profile.java_args is defined %}
# Java Opts
if [ -z "$JAVA_ARGS" ]; then
JAVA_ARGS="{{- artemis_profile.java_args|join(' ') }} "
fi
{% endif %}

if [ "$1" = "run" ]; then :
{% if artemis_profile.debug_args is defined %}
DEBUG_ARGS="$DEBUG_ARGS {{ artemis_profile.debug_args|join(' ') }}"
{% endif %}
{% if artemis_profile.java_args_run is defined %}
JAVA_ARGS="$JAVA_ARGS {{ artemis_profile.java_args_run|join(' ') -}}"
{% endif %}
fi

44 changes: 44 additions & 0 deletions templates/artemis-2.36/bootstrap.xml.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
{% from 'libs/utils.jinja2' import url without context %}
{% include 'libs/headers/xml_header.jinja2' %}
{% include 'libs/licenses/apache-2.0/xml.jinja2' %}

<broker xmlns="http://activemq.apache.org/schema">

{% for jaas in bootstrap_xml.jaas_security %}
<jaas-security domain="{{ jaas.domain }}"
{%- if jaas.certificate_domain is defined %}
certificate-domain="{{ jaas.certificate_domain}}"
{%- endif %}/>
{% endfor %}


<server configuration="{{ bootstrap_xml.server.configuration }}"/>

<web path="{{ bootstrap_xml.web.path }}" rootRedirectLocation="{{ bootstrap_xml.web.rootRedirectLocation }}">
{% for binding in bootstrap_xml.web.bindings %}
<binding
{% for attribute_key, attribute_value in binding.items() %}
{% if attribute_key == 'uri' %}
uri="{{ attribute_value }}"
{% else %}
{{ attribute_key }}="{{ attribute_value }}"
{% endif %}
{% endfor %}
>
{% endfor %}

{% for app in bootstrap_xml.web.apps %}
{% if app.name is defined %}
<app name="{{ app.name }}" url="{{ app.url }}" war="{{ app.war }}"/>
{% else %}
<app url="{{ app.url }}" war="{{ app.war }}"/>
{% endif %}
{% endfor %}
</binding>
</web>


</broker>


57 changes: 57 additions & 0 deletions templates/artemis-2.36/broker.xml.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version='1.0'?>
{% from 'libs/utils.jinja2' import mbool without context %}
{% from 'libs/utils.jinja2' import url without context %}
{% include 'libs/headers/xml_header.jinja2' %}

{% include 'libs/licenses/apache-2.0/xml.jinja2' %}

<configuration xmlns="urn:activemq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">

<core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:activemq:core ">

<name>{{ broker_xml.name }}</name>


{% include 'modules/broker_xml/journal.jinja2' %}

<disk-scan-period>{{ broker_xml.disk_scan_period }}</disk-scan-period>

<max-disk-usage>{{ broker_xml.max_disk_usage }}</max-disk-usage>

{% include 'modules/broker_xml/critical_analyzer.jinja2' %}

{% if broker_xml.page_sync_timeout is defined %}
<page-sync-timeout>{{ broker_xml.page_sync_timeout }}</page-sync-timeout>

{% endif %}

{% if broker_xml.global_max_size is defined %}
<global-max-size>{{ broker_xml.global_max_size }}</global-max-size>

{% endif %}
{% if broker_xml.global_max_message is defined %}
<global-max-messages>{{ broker_xml.global_max_message }}</global-max-messages>

{% endif %}
{% include 'modules/broker_xml/acceptors.jinja2' %}
{% include 'modules/broker_xml/connectors.jinja2' %}
{% include 'modules/broker_xml/cluster.jinja2' %}
{% include 'modules/broker_xml/broadcast_group.jinja2' %}
{% include 'modules/broker_xml/discovery_group.jinja2' %}
{% include 'modules/broker_xml/cluster_connections.jinja2' %}
{% include 'modules/broker_xml/ha_policy.jinja2' %}
{% include 'modules/broker_xml/store.jinja2' %}
{% include 'modules/broker_xml/security_settings.jinja2' %}
{% include 'modules/broker_xml/wildcards_addresses.jinja2' %}
{% include 'modules/broker_xml/address_settings.jinja2' %}
{% include 'modules/broker_xml/addresses.jinja2' %}
{% include 'modules/broker_xml/broker_plugins.jinja2' %}
{% include 'modules/broker_xml/grouping_handler.jinja2' %}
{% include 'modules/broker_xml/duplicate_cache.jinja2' %}

</core>
</configuration>
18 changes: 18 additions & 0 deletions templates/artemis-2.36/jolokia-access.xml.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
{% include 'libs/headers/xml_header.jinja2' %}
{% include 'libs/licenses/apache-2.0/xml.jinja2' %}

<restrict>

<cors>
{% for origin in jolokia_access.allow_origins %}
<allow-origin>{{ origin }}</allow-origin>
{% endfor %}


{% if jolokia_access.strict_checking %}
<strict-checking/>
{% endif %}
</cors>

</restrict>
Loading

0 comments on commit 5031780

Please sign in to comment.