Merge pull request #461 from bilsch/missing_becomes

add missing become: root
This commit is contained in:
Michael Russell 2018-06-28 15:02:31 +02:00 committed by GitHub
commit 27fcaa1383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -95,6 +95,7 @@
register: sysd_stat_result register: sysd_stat_result
- name: Remove if it is a normal file - name: Remove if it is a normal file
become: yes
file: file:
path: "{{ sysd_script }}" path: "{{ sysd_script }}"
state: absent state: absent

View file

@ -56,6 +56,7 @@
meta: flush_handlers meta: flush_handlers
- name: Make sure elasticsearch is started - name: Make sure elasticsearch is started
become: yes
service: name={{instance_init_script | basename}} state=started enabled=yes service: name={{instance_init_script | basename}} state=started enabled=yes
when: es_start_service when: es_start_service

View file

@ -17,6 +17,7 @@
when: (es_enable_xpack and "security" in es_xpack_features) and (es_version | version_compare('6.0.0', '>')) when: (es_enable_xpack and "security" in es_xpack_features) and (es_version | version_compare('6.0.0', '>'))
block: block:
- name: create the keystore if it doesn't exist yet - name: create the keystore if it doesn't exist yet
become: yes
command: > command: >
{{es_home}}/bin/elasticsearch-keystore create {{es_home}}/bin/elasticsearch-keystore create
args: args:
@ -25,6 +26,7 @@
ES_PATH_CONF: "{{ conf_dir }}" ES_PATH_CONF: "{{ conf_dir }}"
- name: Check if bootstrap password is set - name: Check if bootstrap password is set
become: yes
command: > command: >
{{es_home}}/bin/elasticsearch-keystore list {{es_home}}/bin/elasticsearch-keystore list
register: list_keystore register: list_keystore
@ -33,6 +35,7 @@
ES_PATH_CONF: "{{ conf_dir }}" ES_PATH_CONF: "{{ conf_dir }}"
- name: Create Bootstrap password for elastic user - 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' shell: echo "{{es_api_basic_auth_password}}" | {{es_home}}/bin/elasticsearch-keystore add -x 'bootstrap.password'
when: 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 - 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