Bootstrap changes only for ES 6.x and with xpack

This commit is contained in:
Shri Bodas 2018-01-10 09:49:24 -08:00 committed by Michael Russell
parent e77cdc586d
commit 89601d731d
No known key found for this signature in database
GPG key ID: A90C1696496085FE
2 changed files with 4 additions and 2 deletions

View file

@ -16,3 +16,4 @@
- name: Set elasticsearch.keystore Permissions
become: yes
file: state=file path={{ conf_dir }}/elasticsearch.keystore owner={{ es_user }} group={{ es_group }}
when: es_enable_xpack and "security" in es_xpack_features and (es_version | version_compare('6.0.0', '>'))

View file

@ -18,12 +18,13 @@
register: list_keystore
environment:
ES_PATH_CONF: "{{ conf_dir }}"
when:
- (es_enable_xpack and '"security" in es_xpack_features') and (es_version | version_compare('6.0.0', '>'))
- name: Create Bootstrap password for elastic user
shell: echo "{{es_api_basic_auth_password}}" | {{es_home}}/bin/elasticsearch-keystore add -x 'bootstrap.password'
when:
- es_api_basic_auth_username == 'elastic' and 'bootstrap.password' not in list_keystore.stdout_lines
- (es_enable_xpack and '"security" in es_xpack_features') and (es_version | version_compare('6.0.0', '>')) and es_api_basic_auth_username is defined and list_keystore is defined and es_api_basic_auth_username == 'elastic' and 'bootstrap.password' not in list_keystore.stdout_lines
environment:
ES_PATH_CONF: "{{ conf_dir }}"
no_log: true