Check if the certificates exist or not

This commit is contained in:
manuasir 2019-06-28 15:20:14 +02:00
parent 868cf75ca7
commit 02e4bd951b

View File

@ -131,12 +131,21 @@
- node_generate_certs
- elasticsearch_xpack_security
- name: Check that the certificates ZIP file exists
stat:
path: /usr/share/elasticsearch/certs.zip
register: xpack_certs_zip
when:
- node_generate_certs
- elasticsearch_xpack_security
- name: Generating certificates for Elasticsearch security
shell: "/usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem --in /usr/share/elasticsearch/instances.yml --out /usr/share/elasticsearch/certs.zip"
when:
- node_generate_certs
- instances_file_exists
- elasticsearch_xpack_security
- not xpack_certs_zip
tags: xpack-security
# - name: Importing certificates generated previously
@ -153,13 +162,6 @@
# - elasticsearch_xpack_security
# tags: xpack-security
- name: Importing certificate generated previously
shell: "/usr/bin/rsync -avg -e 'ssh -o StrictHostKeyChecking=no' --rsync-path='sudo rsync' vagrant@172.16.0.161:/usr/share/elasticsearch/{{elasticsearch_node_name}}/ /home/es_certificates/"
when:
- not node_generate_certs
- elasticsearch_xpack_security
tags: xpack-security
- import_tasks: "RMRedHat.yml"
when: ansible_os_family == "RedHat"