feat: manage users
This commit is contained in:
parent
aaeea21e54
commit
f1ba54d2ad
10 changed files with 228 additions and 26 deletions
tasks
|
@ -1,8 +1,31 @@
|
|||
---
|
||||
- name: Init elastic password
|
||||
elasticsearch_init_password:
|
||||
api_user: "{{ elasticsearch_api_user }}"
|
||||
api_password: "{{ elasticsearch_password }}"
|
||||
run_once: true
|
||||
tags: elasticsearch
|
||||
|
||||
- name: Manage users
|
||||
elasticsearch_user:
|
||||
name: "{{ item.key }}"
|
||||
password: "{{ item.value.password }}"
|
||||
roles: "{{ item.value.roles | default(omit) }}"
|
||||
api_user: "{{ elasticsearch_api_user }}"
|
||||
api_password: "{{ elasticsearch_password }}"
|
||||
state: "{{ item.value.state | default('present') }}"
|
||||
loop: "{{ elasticsearch_users | dict2items }}"
|
||||
loop_control:
|
||||
label: "{{ item.key }}"
|
||||
run_once: true
|
||||
tags: elasticsearch
|
||||
|
||||
- name: Copy ilm policies
|
||||
elasticsearch_ilm_policy:
|
||||
name: "{{ item.key }}"
|
||||
phases: "{{ item.value | default({}) }}"
|
||||
api_user: "{{ elasticsearch_api_user }}"
|
||||
api_password: "{{ elasticsearch_password }}"
|
||||
loop: "{{ elasticsearch_ilm_policies | dict2items }}"
|
||||
loop_control:
|
||||
label: "{{ item.key }}"
|
||||
|
@ -15,6 +38,10 @@
|
|||
index_patterns: "{{ item.value.index_patterns }}"
|
||||
settings: "{{ item.value.settings | default({}) }}"
|
||||
mappings: "{{ item.value.mappings | default({}) }}"
|
||||
api_user: "{{ elasticsearch_api_user }}"
|
||||
api_password: "{{ elasticsearch_password }}"
|
||||
loop: "{{ elasticsearch_index_templates | dict2items }}"
|
||||
loop_control:
|
||||
label: "{{ item.key }}"
|
||||
run_once: true
|
||||
tags: elasticsearch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue