Skip to content

AMW-377 After creating a broker, it is not possible to update the keystore password in bootstrap.xml #221

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
podman_tests_current: >-
[ "default", "amq_upgrade", "custom_xml", "federation", "mask_passwords", "uninstall" ]
podman_tests_next: >-
[ "default", "amq_upgrade", "custom_xml", "federation", "mask_passwords", "uninstall" ]
[ "default", "amq_upgrade", "custom_xml", "federation", "mask_passwords", "uninstall" ]
14 changes: 14 additions & 0 deletions molecule/static_cluster/verify.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
- name: Verify
hosts: all
vars:
activemq_instance_home: /opt/amq/amq-broker
activemq_tls_keystore_password: securepass
tasks:
- name: Populate service facts
ansible.builtin.service_facts:
Expand Down Expand Up @@ -67,3 +70,14 @@
- ansible_facts.activemq.Backup == true
- ansible_facts.activemq.SharedStore == true
when: inventory_hostname == 'instance2'

- name: "Check if bootstrap.xml contains the updated keystore password"
ansible.builtin.command: sed -n 's/.*keyStorePassword="\([^"]*\)".*/\1/p' "{{ activemq_instance_home }}/etc/bootstrap.xml"
register: bootstrap_keystore_password
changed_when: false
failed_when: bootstrap_keystore_password.rc != 0

- name: "Fail if bootstrap.xml does not have the updated keystore password"
ansible.builtin.fail:
msg: "Keystore password in bootstrap.xml is not updated! Expected: {{ activemq_tls_keystore_password }}, Found: {{ bootstrap_keystore_password.stdout }}"
when: bootstrap_keystore_password.stdout != "securepass"
13 changes: 13 additions & 0 deletions roles/activemq/tasks/configure_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@
notify:
- restart amq_broker

- name: "Update keystore password in all bindings inside bootstrap.xml"
become: "{{ activemq_install_requires_become | default(true) }}"
middleware_automation.common.xml:
path: "{{ activemq.instance_home }}/etc/bootstrap.xml"
xpath: '//b:binding'
attribute: keyStorePassword
value: "{{ activemq_tls_keystore_password }}"
namespaces:
b: http://activemq.apache.org/schema
notify:
- restart amq_broker
when: activemq_tls_enabled

- name: "Configure using properties file"
become: "{{ activemq_install_requires_become | default(true) }}"
ansible.builtin.template:
Expand Down
Loading