Abstract 6.3 changes into a separate task to reduce all of the jinja one

liner complexity

Set ES_PATH_CONF when installing so upgrading from 6.2 to 6.3 works as
expected
This commit is contained in:
Michael Russell 2018-06-14 14:44:31 +02:00
parent 715bd8591e
commit bbc5e0603d
No known key found for this signature in database
GPG key ID: A90C1696496085FE
9 changed files with 52 additions and 13 deletions

View file

@ -18,7 +18,7 @@
- name: Remove Users
become: yes
command: >
{{es_home}}/bin/x-pack/users userdel {{item}}
{{es_home}}/bin/{{es_xpack_users_command}} userdel {{item}}
with_items: "{{users_to_remove | default([])}}"
when: manage_file_users
environment:
@ -34,7 +34,7 @@
- name: Add Users
become: yes
command: >
{{es_home}}/bin/x-pack/users useradd {{item}} -p {{es_users.file[item].password}}
{{es_home}}/bin/{{es_xpack_users_command}} useradd {{item}} -p {{es_users.file[item].password}}
with_items: "{{ users_to_add | default([]) }}"
when: manage_file_users
no_log: True
@ -47,12 +47,12 @@
- name: Set User Passwords
become: yes
command: >
{{es_home}}/bin/x-pack/users passwd {{ item }} -p {{es_users.file[item].password}}
{{es_home}}/bin/{{es_xpack_users_command}} passwd {{ item }} -p {{es_users.file[item].password}}
with_items: "{{ es_users.file.keys() | default([]) }}"
when: manage_file_users
#Currently no easy way to figure out if the password has changed or to know what it currently is so we can skip.
changed_when: False
no_log: True
no_log: False
environment:
CONF_DIR: "{{ conf_dir }}"
ES_PATH_CONF: "{{ conf_dir }}"

View file

@ -19,7 +19,8 @@
- name: create the keystore if it doesn't exist yet
command: >
{{es_home}}/bin/elasticsearch-keystore create
creates: "{{ conf_dir }}/elasticsearch.keystore"
args:
creates: "{{ conf_dir }}/elasticsearch.keystore"
environment:
ES_PATH_CONF: "{{ conf_dir }}"