-
Notifications
You must be signed in to change notification settings - Fork 2
/
100_Import_Ressources.yml
68 lines (60 loc) · 2.69 KB
/
100_Import_Ressources.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Eyes of Log - Ressources integration
# Axians - Brice VALENZA
---
- name: Ressources integration
hosts: elasticsearch_master_nodes[0]
gather_facts: no
tasks:
- name: Create All pipelines from files/EyesOfLog/pipelines folder to Elasticsearch (use master node)
uri:
url: "https://{{ hostvars[inventory_hostname].groups.elasticsearch_master_nodes[0] }}:{{ eol.cluster.es_api_port }}/_ingest/pipeline/{{ item | basename | splitext | first }}"
method: PUT
status_code: 200
user: "{{ eol.cluster.api_username }}"
password: "{{ eol.cluster.api_password }}"
force_basic_auth: yes
body_format: json
body: "{{ lookup('file', item) }}"
validate_certs: "no"
with_fileglob:
- "files/EyesOfLog/pipelines/*.json"
- name: Create All component template from files/EyesOfLog/component-template folder to Elasticsearch (use master node)
uri:
url: "https://{{ hostvars[inventory_hostname].groups.elasticsearch_master_nodes[0] }}:{{ eol.cluster.es_api_port }}/_component_template/{{ item | basename | splitext | first }}"
method: PUT
status_code: 200
user: "{{ eol.cluster.api_username }}"
password: "{{ eol.cluster.api_password }}"
force_basic_auth: yes
body_format: json
body: "{{ lookup('file', item) }}"
validate_certs: "no"
with_fileglob:
- "files/EyesOfLog/component-template/*.json"
- name: Create default lifecycle Policies for EyesOfLogs
uri:
url: "https://{{ hostvars[inventory_hostname].groups.elasticsearch_master_nodes[0] }}:{{ eol.cluster.es_api_port }}/_ilm/policy/{{ item | basename | splitext | first }}"
method: PUT
status_code: 200
user: "{{ eol.cluster.api_username }}"
password: "{{ eol.cluster.api_password }}"
force_basic_auth: yes
body_format: json
body: "{{ lookup('template', item) }}"
validate_certs: "no"
with_fileglob:
- "files/EyesOfLog/lifecycle/*.json"
- name: Create All index templates from files/EyesOfLog/index_templates folder to Elasticsearch (use master node)
uri:
url: "https://{{ hostvars[inventory_hostname].groups.elasticsearch_master_nodes[0] }}:{{ eol.cluster.es_api_port }}/_index_template/{{ item | basename | splitext | first }}"
method: PUT
status_code: 200
user: "{{ eol.cluster.api_username }}"
password: "{{ eol.cluster.api_password }}"
force_basic_auth: yes
body_format: json
body: "{{ lookup('template', item) }}"
validate_certs: "no"
with_fileglob:
- "files/EyesOfLog/index_templates/*.json"
register: this