From 3707af148874b34301c3b120d188204c57933deb Mon Sep 17 00:00:00 2001 From: pemontto Date: Fri, 18 Oct 2019 17:51:44 +0100 Subject: [PATCH] Fix conditional for password removal --- tasks/elasticsearch-ssl.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/elasticsearch-ssl.yml b/tasks/elasticsearch-ssl.yml index 400c63b..7f56a98 100644 --- a/tasks/elasticsearch-ssl.yml +++ b/tasks/elasticsearch-ssl.yml @@ -51,7 +51,7 @@ - name: Set keystore password shell: echo "{{ es_ssl_keystore_password }}" | {{ es_home }}/bin/elasticsearch-keystore add -x -f 'xpack.security.{{ item }}.ssl.keystore.secure_password' no_log: True - when: es_ssl_keystore_password and copy_keystore.changed or (es_same_keystore and copy_truststore.changed) + when: es_ssl_keystore_password and (copy_keystore.changed or (es_same_keystore and copy_truststore.changed)) with_items: - http - transport @@ -59,14 +59,14 @@ - name: Set truststore password shell: echo "{{ es_ssl_truststore_password }}" | {{ es_home }}/bin/elasticsearch-keystore add -x -f 'xpack.security.{{ item }}.ssl.truststore.secure_password' no_log: True - when: es_ssl_truststore_password and copy_truststore.changed or (es_same_keystore and copy_keystore.changed) + when: es_ssl_truststore_password and (copy_truststore.changed or (es_same_keystore and copy_keystore.changed)) with_items: - http - transport - name: Remove keystore password shell: "{{ es_home }}/bin/elasticsearch-keystore remove 'xpack.security.{{ item }}.ssl.keystore.secure_password'" - when: es_ssl_keystore_password == "" and copy_keystore.changed or (es_same_keystore and copy_truststore.changed) + when: es_ssl_keystore_password == "" and (copy_keystore.changed or (es_same_keystore and copy_truststore.changed)) ignore_errors: yes with_items: - http @@ -74,7 +74,7 @@ - name: Remove truststore password shell: "{{ es_home }}/bin/elasticsearch-keystore remove 'xpack.security.{{ item }}.ssl.truststore.secure_password'" - when: es_ssl_truststore_password == "" and copy_truststore.changed or (es_same_keystore and copy_keystore.changed) + when: es_ssl_truststore_password == "" and (copy_truststore.changed or (es_same_keystore and copy_keystore.changed)) ignore_errors: yes with_items: - http