Merge "Make index retention calculation pluggable"
This commit is contained in:
commit
050fdbc880
24
elk_metrics_6x/calculate_index_retention_default.yml
Normal file
24
elk_metrics_6x/calculate_index_retention_default.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
|
||||
- name: Set assumed buffer storage fact
|
||||
set_fact:
|
||||
es_assumed_buffer_storage: "{{ ((es_total_available_storage | int) * 0.25) | round | int }}"
|
||||
|
||||
- name: Set usable buffer storage fact(s)
|
||||
set_fact:
|
||||
es_usable_buffer_storage: "{{ (es_total_available_storage | int) - (es_assumed_buffer_storage | int) }}"
|
||||
es_expected_storage: "{{ ((elastic_beat_retention_policy_hosts.values() | map('int') | list) | sum) * (elastic_beat_storage_constant | int) }}"
|
||||
|
||||
- name: Set buffer storage fact
|
||||
set_fact:
|
||||
es_assumed_usable_storage_per_node: "{{ (es_usable_buffer_storage | int) // (data_nodes | length | int) }}"
|
||||
|
||||
- name: Set storage the mulitplier
|
||||
set_fact:
|
||||
es_storage_multiplier: "{{ ((es_usable_buffer_storage | int) < (es_expected_storage | int)) | ternary(((elastic_beat_storage_constant | int) * 2), elastic_beat_storage_constant | int) }}"
|
||||
|
||||
- name: Set retention facts
|
||||
set_fact: "elastic_{{ item.key }}_retention={{ (es_assumed_usable_storage_per_node | int) // ((item.value | int) * (es_storage_multiplier | int)) }}"
|
||||
when:
|
||||
- hostvars[inventory_hostname]["elastic_" + item.key + "_retention"] is undefined
|
||||
with_dict: "{{ elastic_beat_retention_policy_hosts }}"
|
@ -44,28 +44,8 @@
|
||||
set_fact:
|
||||
es_total_available_storage: "{{ ((elk_data['json']['nodes'].values() | list) | map(attribute='fs.total.total_in_bytes') | list | sum) // 1024 // 1024 }}"
|
||||
|
||||
- name: Set assumed buffer storage fact
|
||||
set_fact:
|
||||
es_assumed_buffer_storage: "{{ ((es_total_available_storage | int) * 0.25) | round | int }}"
|
||||
|
||||
- name: Set usable buffer storage fact(s)
|
||||
set_fact:
|
||||
es_usable_buffer_storage: "{{ (es_total_available_storage | int) - (es_assumed_buffer_storage | int) }}"
|
||||
es_expected_storage: "{{ ((elastic_beat_retention_policy_hosts.values() | map('int') | list) | sum) * (elastic_beat_storage_constant | int) }}"
|
||||
|
||||
- name: Set buffer storage fact
|
||||
set_fact:
|
||||
es_assumed_usable_storage_per_node: "{{ (es_usable_buffer_storage | int) // (data_nodes | length | int) }}"
|
||||
|
||||
- name: Set storage the mulitplier
|
||||
set_fact:
|
||||
es_storage_multiplier: "{{ ((es_usable_buffer_storage | int) < (es_expected_storage | int)) | ternary(((elastic_beat_storage_constant | int) * 2), elastic_beat_storage_constant | int) }}"
|
||||
|
||||
- name: Set retention facts
|
||||
set_fact: "elastic_{{ item.key }}_retention={{ (es_assumed_usable_storage_per_node | int) // ((item.value | int) * (es_storage_multiplier | int)) }}"
|
||||
when:
|
||||
- hostvars[inventory_hostname]["elastic_" + item.key + "_retention"] is undefined
|
||||
with_dict: "{{ elastic_beat_retention_policy_hosts }}"
|
||||
- name: Compute index retention
|
||||
include_tasks: "calculate_index_retention_{{ elastic_index_retention_algorithm | default('default') }}.yml"
|
||||
|
||||
- name: Ensure virtualenv is installed
|
||||
apt:
|
||||
|
Loading…
x
Reference in New Issue
Block a user