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

Java minor version is hardcoded in /etc/sysconfig/amq-broker #81

Closed
RobertFloor opened this issue Jul 10, 2023 · 2 comments · Fixed by #82
Closed

Java minor version is hardcoded in /etc/sysconfig/amq-broker #81

RobertFloor opened this issue Jul 10, 2023 · 2 comments · Fixed by #82
Assignees
Labels
bugfixes Fixes that resolve issues. SHOULD not be used for minor enhancements

Comments

@RobertFloor
Copy link

SUMMARY

The Java Version used is hardcoded in this file for systemd: https://github.com/ansible-middleware/amq/blob/main/roles/activemq/templates/amq_broker.sysconfig.j2, /etc/sysconfig/amq-broker. That means that if you update the packages in between without changing this file, (and it includes a java update) you are no longer able to start using systemd. We have different persons responsible for updating systems and running the application. So the infrastructure team can update the packages without the AMQ team knowing. This will leas to a situation where the broker cannot start with systemd. Therefore I believe this strict coupling in this file with the Java version is not desired.

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible [core 2.12.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/[email protected]/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  ansible collection location = /home/[email protected]/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.8.13 (default, Jun 14 2022, 17:49:07) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)]
  jinja version = 2.11.3
  libyaml = True
COLLECTION VERSION
Collection                                Version
----------------------------------------- -------
ansible.posix                             1.5.4
community.general                         6.0.1
middleware_automation.amq                 1.3.6
middleware_automation.common              1.1.0
middleware_automation.redhat_csp_download 1.2.2

# /usr/lib/python3.8/site-packages/ansible_collections
Collection                    Version
----------------------------- -------
amazon.aws                    2.1.0
ansible.netcommon             2.5.1
ansible.posix                 1.3.0
ansible.utils                 2.5.0
ansible.windows               1.9.0
arista.eos                    3.1.0
awx.awx                       19.4.0
azure.azcollection            1.11.0
check_point.mgmt              2.2.2
chocolatey.chocolatey         1.2.0
cisco.aci                     2.1.0
cisco.asa                     2.1.0
cisco.intersight              1.0.18
cisco.ios                     2.7.1
cisco.iosxr                   2.7.0
cisco.ise                     1.2.1
cisco.meraki                  2.6.0
cisco.mso                     1.3.0
cisco.nso                     1.0.3
cisco.nxos                    2.9.0
cisco.ucs                     1.6.0
cloud.common                  2.1.0
cloudscale_ch.cloud           2.2.0
community.aws                 2.3.0
community.azure               1.1.0
community.ciscosmb            1.0.4
community.crypto              2.2.2
community.digitalocean        1.15.1
community.dns                 2.0.7
community.docker              2.2.0
community.fortios             1.0.0
community.general             4.5.0
community.google              1.0.0
community.grafana             1.3.2
community.hashi_vault         2.3.0
community.hrobot              1.2.2
community.kubernetes          2.0.1
community.kubevirt            1.0.0
community.libvirt             1.0.2
community.mongodb             1.3.2
community.mysql               2.3.4
community.network             3.0.0
community.okd                 2.1.0
community.postgresql          1.7.0
community.proxysql            1.3.1
community.rabbitmq            1.1.0
community.routeros            2.0.0
community.skydive             1.0.0
community.sops                1.2.0
community.vmware              1.17.1
community.windows             1.9.0
community.zabbix              1.5.1
containers.podman             1.9.1
cyberark.conjur               1.1.0
cyberark.pas                  1.0.13
dellemc.enterprise_sonic      1.1.0
dellemc.openmanage            4.4.0
dellemc.os10                  1.1.1
dellemc.os6                   1.0.7
dellemc.os9                   1.0.4
f5networks.f5_modules         1.14.0
fortinet.fortimanager         2.1.4
fortinet.fortios              2.1.4
frr.frr                       1.0.3
gluster.gluster               1.0.2
google.cloud                  1.0.2
hetzner.hcloud                1.6.0
hpe.nimble                    1.1.4
ibm.qradar                    1.0.3
infinidat.infinibox           1.3.3
infoblox.nios_modules         1.2.1
inspur.sm                     1.3.0
junipernetworks.junos         2.9.0
kubernetes.core               2.2.3
mellanox.onyx                 1.0.0
netapp.aws                    21.7.0
netapp.azure                  21.10.0
netapp.cloudmanager           21.14.0
netapp.elementsw              21.7.0
netapp.ontap                  21.16.0
netapp.storagegrid            21.9.0
netapp.um_info                21.8.0
netapp_eseries.santricity     1.2.13
netbox.netbox                 3.5.1
ngine_io.cloudstack           2.2.3
ngine_io.exoscale             1.0.0
ngine_io.vultr                1.1.0
openstack.cloud               1.7.0
openvswitch.openvswitch       2.1.0
ovirt.ovirt                   1.6.6
purestorage.flasharray        1.12.1
purestorage.flashblade        1.9.0
sensu.sensu_go                1.13.0
servicenow.servicenow         1.0.6
splunk.es                     1.0.2
t_systems_mms.icinga_director 1.27.1
theforeman.foreman            2.2.0
vyos.vyos                     2.7.0
wti.remote                    1.0.3
STEPS TO REPRODUCE
  1. Install AMQ using playbook (this works)
  2. A Java update to RHEL comes along
  3. Someone performs a dnf update to update java, not running the playbook again, the JAVA HOME dir is changed now
    4 systemctl start amq-broker.service no longer works since it points to an old java version in JAVA_HOME
EXPECTED RESULTS

I expect the broker to continue to work with systemd after a java minor update

ACTUAL RESULTS

Systemctl did not start did not give any other logging then cannot start. It was still possible to start artemis-service

@RobertFloor
Copy link
Author

The AMQ application as installed with this playbook also start correctly with systemd if JAVA_HOME is not defined in the sysconfig file but the java location from the PATH variable is used. So I removed JAVA_HOME from /etc/sysconfig/amq-broker and it still starts.

@guidograzioli guidograzioli added the bugfixes Fixes that resolve issues. SHOULD not be used for minor enhancements label Jul 10, 2023
@guidograzioli guidograzioli self-assigned this Jul 10, 2023
@guidograzioli
Copy link
Member

Hello; we would like to retain the functionality of enforcing the version of JRE used by the service, since multiple families of jre can exist at the same time (controlled by alternatives --config or other means). Ie. it could happen that an update to jdk17 is executed but the service runs on jdk11.

That said, you can achieve what you are asking by leveraging the system alternatives facility: set activemq_java_home: /etc/alternatives/jre (or also fixing the major version activemq_java_home: /etc/alternatives/jre-XX, or even activemq_java_home: /usr/lib/jvm/jre-XX when other java software runs on the same system on a different jdk).

Setting activemq_java_home disables the part of the role that determines java_home, delegating that to the user.

However, the minor.patch version ending up in the java_home path in the systemd environment template is a bug, and it will be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfixes Fixes that resolve issues. SHOULD not be used for minor enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants