Merge pull request #559 from elastic/template-install
[templates] simplify template install task
This commit is contained in:
commit
a016ff6e10
1 changed files with 4 additions and 17 deletions
|
|
@ -13,29 +13,16 @@
|
|||
with_fileglob:
|
||||
- "{{ es_templates_fileglob | default('') }}"
|
||||
|
||||
- name: Install templates without auth
|
||||
- name: Install templates
|
||||
uri:
|
||||
url: "http://{{es_api_host}}:{{es_api_port}}/_template/{{item | filename}}"
|
||||
method: PUT
|
||||
status_code: 200
|
||||
user: "{{es_api_basic_auth_username | default(omit)}}"
|
||||
password: "{{es_api_basic_auth_password | default(omit)}}"
|
||||
body_format: json
|
||||
body: "{{ lookup('file', item) }}"
|
||||
when: load_templates.changed and es_start_service and (not es_enable_xpack or not es_xpack_features is defined or "security" not in es_xpack_features)
|
||||
with_fileglob:
|
||||
- "{{ es_templates_fileglob | default('') }}"
|
||||
run_once: True
|
||||
|
||||
- name: Install templates with auth
|
||||
uri:
|
||||
url: "http://{{es_api_host}}:{{es_api_port}}/_template/{{item | filename}}"
|
||||
method: PUT
|
||||
status_code: 200
|
||||
user: "{{es_api_basic_auth_username}}"
|
||||
password: "{{es_api_basic_auth_password}}"
|
||||
force_basic_auth: yes
|
||||
body_format: json
|
||||
body: "{{ lookup('file', item) }}"
|
||||
when: load_templates.changed and es_start_service and es_enable_xpack and es_xpack_features is defined and "security" in es_xpack_features
|
||||
when: load_templates.changed and es_start_service
|
||||
with_fileglob:
|
||||
- "{{ es_templates_fileglob | default('') }}"
|
||||
run_once: True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue