Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

add missing become: root #461

Merged
merged 2 commits into from
Jun 28, 2018
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
1 change: 1 addition & 0 deletions tasks/elasticsearch-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
register: sysd_stat_result

- name: Remove if it is a normal file
become: yes
file:
path: "{{ sysd_script }}"
state: absent
Expand Down
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
meta: flush_handlers

- name: Make sure elasticsearch is started
become: yes
service: name={{instance_init_script | basename}} state=started enabled=yes
when: es_start_service

Expand Down
5 changes: 4 additions & 1 deletion tasks/xpack/security/elasticsearch-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
when: (es_enable_xpack and "security" in es_xpack_features) and (es_version | version_compare('6.0.0', '>'))
block:
- name: create the keystore if it doesn't exist yet
become: yes
command: >
{{es_home}}/bin/elasticsearch-keystore create
args:
creates: "{{ conf_dir }}/elasticsearch.keystore"
environment:
ES_PATH_CONF: "{{ conf_dir }}"

- name: Check if bootstrap password is set
become: yes
command: >
{{es_home}}/bin/elasticsearch-keystore list
register: list_keystore
Expand All @@ -33,6 +35,7 @@
ES_PATH_CONF: "{{ conf_dir }}"

- name: Create Bootstrap password for elastic user
become: yes
shell: echo "{{es_api_basic_auth_password}}" | {{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
Expand Down