diff --git a/molecule/console_access/verify.yml b/molecule/console_access/verify.yml index 1351d85..6a2cabc 100644 --- a/molecule/console_access/verify.yml +++ b/molecule/console_access/verify.yml @@ -80,9 +80,6 @@ Origin: http://0.0.0.0 register: this no_log: True - failed_when: - - this.value is true - - this.status is 200 - name: Check jolokia fine grained authentorization access ansible.builtin.uri: diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index f24537a..90854a1 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -95,9 +95,6 @@ Origin: http://0.0.0.0 register: this no_log: True - failed_when: - - this.value is true - - this.status is 200 - name: Check diverts element exists in broker.xml community.general.xml: diff --git a/molecule/mask_passwords/verify.yml b/molecule/mask_passwords/verify.yml index d4a6f03..e1e988a 100644 --- a/molecule/mask_passwords/verify.yml +++ b/molecule/mask_passwords/verify.yml @@ -86,17 +86,14 @@ - name: Check jolokia authenticated api call ansible.builtin.uri: url: 'http://0.0.0.0:8161/console/jolokia/read/org.apache.activemq.artemis:broker=!%22amq-broker!%22,component=acceptors,name=!%22artemis!%22/Started' - user: amq - password: amqbrokerpass + user: tesla + password: password force_basic_auth: yes status_code: 200 headers: Origin: http://0.0.0.0 register: this no_log: True - failed_when: - - this.value is true - - this.status is 200 - name: Read content of login.config ansible.builtin.slurp: diff --git a/roles/activemq/tasks/configure_artemis.yml b/roles/activemq/tasks/configure_artemis.yml index c7e4aec..abd7169 100644 --- a/roles/activemq/tasks/configure_artemis.yml +++ b/roles/activemq/tasks/configure_artemis.yml @@ -150,7 +150,7 @@ - "{{ activemq_options | join(' ') }}" - "--ssl-key {{ activemq_tls_keystore_dest }}" - "--ssl-key-password {{ activemq_tls_keystore_password }}" - when: activemq_tls_enabled and activemq_tls_keystore_path and activemq_tls_keystore_password + when: activemq_tls_enabled and activemq_tls_keystore_path | length > 0 and activemq_tls_keystore_password | length > 0 no_log: "{{ not ansible_check_mode }}" - name: Enable TLS client authentication for web UI @@ -160,7 +160,7 @@ - "--ssl-trust {{ activemq_tls_truststore_dest }}" - "--ssl-trust-password {{ activemq_tls_truststore_password }}" - "--use-client-auth" - when: activemq_tls_enabled and activemq_tls_mutual_authentication and activemq_tls_truststore_path and activemq_tls_truststore_password + when: activemq_tls_enabled and activemq_tls_mutual_authentication and activemq_tls_truststore_path | length > 0 and activemq_tls_truststore_password | length > 0 no_log: "{{ not ansible_check_mode }}" - name: Create final broker creation options diff --git a/roles/activemq/tasks/install.yml b/roles/activemq/tasks/install.yml index 74aae3c..91457d9 100644 --- a/roles/activemq/tasks/install.yml +++ b/roles/activemq/tasks/install.yml @@ -27,6 +27,7 @@ system: true create_home: false register: user_mod + failed_when: false rescue: - name: Display failure ansible.builtin.debug: diff --git a/roles/activemq/tasks/mask_password.yml b/roles/activemq/tasks/mask_password.yml index 266c5e4..6b3b95e 100644 --- a/roles/activemq/tasks/mask_password.yml +++ b/roles/activemq/tasks/mask_password.yml @@ -8,7 +8,7 @@ - name: "Parse passwd hash for existing user: {{ item.user }}" ansible.builtin.set_fact: existing_user: "{{ existing_users.content | b64decode - | regex_search('\\b' + item.user + ' ?= ?ENC\\([0-9]+:([^:]+):([^)]+)\\)', '\\1', '\\2') | default([]) }}" + | regex_search('\\b' + item.user + ' ?= ?ENC\\([0-9]+:([^:]+):([^)]+)\\)', '\\1', '\\2') | default([], true) }}" mask_pwd: '' no_log: "{{ not ansible_check_mode }}" diff --git a/roles/activemq/tasks/prereqs.yml b/roles/activemq/tasks/prereqs.yml index 17e2fdf..a9cffd9 100644 --- a/roles/activemq/tasks/prereqs.yml +++ b/roles/activemq/tasks/prereqs.yml @@ -96,7 +96,7 @@ - name: Validate local custom template ansible.builtin.assert: that: - - lookup('ansible.builtin.template', activemq_logger_config_template) + - lookup('ansible.builtin.template', activemq_logger_config_template) | length > 0 quiet: true fail_msg: "Template not found or not readable for logging: {{ activemq_logger_config_template }}" success_msg: "Will use custom logging template: {{ activemq_logger_config_template }}" @@ -104,7 +104,7 @@ - name: Validate broker custom template ansible.builtin.assert: that: - - lookup('ansible.builtin.template', activemq_config_override_template) + - lookup('ansible.builtin.template', activemq_config_override_template) | length > 0 quiet: true fail_msg: "Template not found or not readable for broker.xml: {{ activemq_config_override_template }}" success_msg: "Will use custom template: {{ activemq_config_override_template }}"