Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tasks/xpack/elasticsearch-xpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#Make sure elasticsearch.keystore has correct Permissions
- name: Set elasticsearch.keystore Permissions
become: yes
file:
ansible.builtin.file:
state: file
path: "{{ es_conf_dir }}/elasticsearch.keystore"
owner: root
Expand Down
14 changes: 7 additions & 7 deletions tasks/xpack/security/elasticsearch-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
block:
- name: create the keystore if it doesn't exist yet
become: yes
command: >
ansible.builtin.command: >
{{es_home}}/bin/elasticsearch-keystore create
args:
creates: "{{ es_conf_dir }}/elasticsearch.keystore"
Expand All @@ -18,7 +18,7 @@

- name: Check if bootstrap password is set
become: yes
command: >
ansible.builtin.command: >
{{es_home}}/bin/elasticsearch-keystore list
register: list_keystore
changed_when: false
Expand All @@ -28,7 +28,7 @@

- name: Create Bootstrap password for elastic user
become: yes
shell: echo {{ es_api_basic_auth_password | quote }} | {{ es_home }}/bin/elasticsearch-keystore add -x 'bootstrap.password'
ansible.builtin.shell: echo {{ es_api_basic_auth_password | quote }} | {{ es_home }}/bin/elasticsearch-keystore add -x 'bootstrap.password'
when:
- 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:
Expand All @@ -37,7 +37,7 @@

- name: Remove keystore entries
become: yes
command: >
ansible.builtin.command: >
{{ es_home }}/bin/elasticsearch-keystore remove '{{ item.key }}'
with_items: "{{ es_keystore_entries }}"
when:
Expand All @@ -49,7 +49,7 @@

- name: Reload keystore entries
become: yes
command: >
ansible.builtin.command: >
{{es_home}}/bin/elasticsearch-keystore list
register: list_keystore
changed_when: false
Expand All @@ -59,7 +59,7 @@

- name: Add keystore entries
become: yes
shell: echo {{ item.value | quote }} | {{ es_home }}/bin/elasticsearch-keystore add -x -f {{ item.key }}
ansible.builtin.shell: echo {{ item.value | quote }} | {{ es_home }}/bin/elasticsearch-keystore add -x -f {{ item.key }}
with_items: "{{ es_keystore_entries }}"
when:
- es_keystore_entries is defined and es_keystore_entries | length > 0
Expand All @@ -81,7 +81,7 @@
#Copy Roles files
- name: Copy role_mapping.yml file for instance
become: yes
template:
ansible.builtin.template:
src: security/role_mapping.yml.j2
dest: "{{ es_conf_dir }}/role_mapping.yml"
owner: root
Expand Down