Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New activemq_systemd_expand_environment parameter #165

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/activemq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ Sample divert:
|`activemq_ha_check_for_active_server`| Whether to check the cluster for a live server using our own server ID when starting up. This option is only necessary for performing 'fail-back' on replicating servers | `false` |
|`activemq_ha_replication_cluster_name`| Name of the cluster configuration to use for replication. This setting is only necessary in case you configure multiple cluster connections | `""` |
|`activemq_ha_replication_group_name`| With replication, if set, remote backup servers will only pair with primary servers with matching group-name | `""` |
|`activemq_systemd_expand_environment` | Whether or not to expand the environment in the sysconfig file. If true, environment file is sourced and the activemq process is started in a shell | `false` |


#### Multi-site fault-tolerance (AMQP broker connections)
Expand Down
1 change: 1 addition & 0 deletions roles/activemq/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ activemq_systemd_wait_for_delay: 10
activemq_systemd_wait_for_log_ha_string: 'AMQ221109\\\\|AMQ221001'
activemq_systemd_wait_for_log_string: 'AMQ221034'
activemq_systemd_wait_for_port_number: "{{ activemq_port }}"
activemq_systemd_expand_environment: false
activemq_ha_role: live-only
activemq_ha_allow_failback: true
activemq_ha_failover_on_shutdown: true
Expand Down
6 changes: 6 additions & 0 deletions roles/activemq/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,12 @@ argument_specs:
description: "The value to use in bootstrap.xml for web console binding"
default: "http{{ 's' if activemq_tls_enabled else '' }}://{{ activemq_bind_address }}:{{ activemq_http_port }}"
type: 'str'
activemq_systemd_expand_environment:
default: false
description: >
Whether or not to expand the environment in the sysconfig file. If true, environment file is sourced and the \
activemq process is started in a shell
type: 'str'
systemd:
options:
activemq_version:
Expand Down
4 changes: 4 additions & 0 deletions roles/activemq/templates/amq_broker.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ Group={{ activemq_service_group }}
Type=forking
EnvironmentFile=-/etc/sysconfig/{{ activemq.instance_name }}
PIDFile={{ activemq.instance_home }}/{{ activemq_service_pidfile }}
{% if activemq_systemd_expand_environment %}
ExecStart=/bin/bash -ac '. /etc/sysconfig/{{ activemq.instance_name }} ; exec {{ activemq.instance_home }}/bin/artemis-service start'
{% else %}
ExecStart={{ activemq.instance_home }}/bin/artemis-service start
{% endif %}
ExecStop={{ activemq.instance_home }}/bin/artemis-service stop
SuccessExitStatus = 0 143
RestartSec = 120
Expand Down