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