2020-02-09 14:15:24 +00:00
|
|
|
---
|
2020-03-08 17:35:44 +00:00
|
|
|
- name: manage users
|
|
|
|
elasticsearch_user:
|
|
|
|
name: '{{ item.key }}'
|
|
|
|
password: '{{ item.value.password }}'
|
|
|
|
api_user: '{{ elasticsearch_api_user }}'
|
|
|
|
api_password: '{{ elasticsearch_api_password }}'
|
|
|
|
loop: '{{ elasticsearch_users|dict2items }}'
|
|
|
|
when: |
|
|
|
|
'xpack.security.enabled' in elasticsearch_full_config and
|
|
|
|
elasticsearch_full_config['xpack.security.enabled'] == True
|
|
|
|
run_once: true
|
|
|
|
tags: elasticsearch
|
|
|
|
|
2020-02-09 14:15:24 +00:00
|
|
|
- name: copy index templates
|
|
|
|
elasticsearch_template:
|
|
|
|
name: '{{ item.key }}'
|
|
|
|
index_patterns: '{{ item.value.index_patterns }}'
|
|
|
|
settings: '{{ item.value.settings|default({}) }}'
|
|
|
|
mappings: '{{ item.value.mappings|default({}) }}'
|
2020-03-08 17:35:44 +00:00
|
|
|
api_user: '{{ elasticsearch_api_user }}'
|
|
|
|
api_password: '{{ elasticsearch_api_password }}'
|
2020-02-09 14:15:24 +00:00
|
|
|
no_log: true
|
|
|
|
loop: '{{ elasticsearch_index_templates|dict2items }}'
|
|
|
|
run_once: true
|
|
|
|
tags: elasticsearch
|