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

Parameter activemq_logger_config_template allows relative paths #116

Merged

Conversation

guidograzioli
Copy link
Member

@guidograzioli guidograzioli commented Mar 7, 2024

It is now possible to pass the filename relative to playbook search paths as:

 activemq_logger_config_template: logging/custom.log4j2.properties.j2

This will template the file and copy at the correct destination stripping the directory and the jinja extension (if present). The original basename will be kept if activemq_logger_config_keep_name: True. and it will then be passed to the JVM arguments as:

-Dlog4j.configurationFile=<custom_template>

Parameter recap:

Variable Description Default
activemq_logger_audit_rollover_files Number of rollover audit log files 5
activemq_logger_config_template_path Optional subdirectory of any playbook template lookup directories for the logging facility configuration ''
activemq_logger_config_keep_name Whether to keep the custom template filename or use the default False

This change also refactor how JVM parameters are built in the role defaults; no changes will be needed to preserve behaviour if the activemq_java_opts parameter has already been overriden; otherwise, new parameters with defaults have been created that will be concatenated in the final JVM arguments, which can be overridden independently.

Variable Description Default
activemq_java_opts_extra Arbitrary extra arguments for the JVM ""
activemq_java_opts_mem Memory arguments for the JVM -Xms512M -Xmx2G"
activemq_java_opts_gc Garbage collection arguments for the JVM -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication
activemq_java_opts_hawtio Hawtio arguments for the JVM -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal

with activemq_java_opts now redefined as:

activemq_java_opts: "{{ [
   activemq_java_opts_mem,
   activemq_java_opts_gc,
   activemq_java_opts_hawtio,
   '-Djolokia.policyLocation=file:' + activemq_dest + '/' + activemq_instance_name + '/etc/jolokia-access.xml',
   activemq_java_opts_extra | default('')
 ] | join(' ') }}"

Fix #112

@guidograzioli guidograzioli changed the title 112 logger config New parameter activemq_logger_config_template allows to pass custom log4j2 config Mar 8, 2024
@guidograzioli guidograzioli changed the title New parameter activemq_logger_config_template allows to pass custom log4j2 config New parameter activemq_logger_config_template allows custom log4j2 configs Mar 8, 2024
@guidograzioli guidograzioli changed the title New parameter activemq_logger_config_template allows custom log4j2 configs Parameter activemq_logger_config_template allows relative paths Mar 8, 2024
@guidograzioli guidograzioli added the major_changes Major changes mean the user can CHOOSE to make a change when they update but do not have to label Mar 8, 2024
@guidograzioli guidograzioli merged commit ca010bc into ansible-middleware:main Mar 8, 2024
14 checks passed
@guidograzioli guidograzioli added minor_changes New parameters added to modules, or non-breaking behavior changes to existing parameters; no bugfix and removed major_changes Major changes mean the user can CHOOSE to make a change when they update but do not have to labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor_changes New parameters added to modules, or non-breaking behavior changes to existing parameters; no bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overriding "logger config template" does not work as expected
1 participant