Propagated ILM changes to auditbeat install

The improvements made to ILM handling in changeset
I2c5c3abd4bb65075f2377227cbbfe31b68b0dc38 did not include auditbeat. This commit
propagates them, such that auditbeat ILM configuration works as for the other
beats.

Change-Id: Icf0190dea0bd1eab14451866f4dca91886812a39
This commit is contained in:
Duncan Martin Walker 2020-02-05 17:50:40 +00:00
parent ed345ece52
commit f8303324cb
3 changed files with 39 additions and 0 deletions

View File

@ -14,3 +14,14 @@
# limitations under the License.
auditbeat_service_state: restarted
auditbeat_ilm_policy_name: "auditbeat-{{ beat_version }}"
auditbeat_ilm_policy_template: "auditbeat-{{ beat_version }}"
auditbeat_ilm_policy_filename: "auditbeat-ilm-policy.json"
auditbeat_ilm_policy_file_location: "/etc/auditbeat"
ilm_policy_name: "{{ auditbeat_ilm_policy_name | default('') }}"
ilm_policy: "{{ (auditbeat_ilm_policy | default(default_ilm_policy)) | default({}) }}"
ilm_policy_template: "{{ auditbeat_ilm_policy_template | default('') }}"
ilm_policy_filename: "{{ (auditbeat_ilm_policy_filename | default(default_ilm_policy_filename)) | default('') }}"
ilm_policy_file_location: "{{ (auditbeat_ilm_policy_file_location | default(default_ilm_policy_file_location)) | default('') }}"

View File

@ -82,6 +82,10 @@
notify:
- Enable and restart auditbeat
- include_role:
name: elastic_ilm
when: ilm_policy.keys() | length > 0
- name: Run the beat setup role
include_role:
name: elastic_beat_setup

View File

@ -813,6 +813,30 @@ processors:
#=============================== Template ======================================
{{ elk_macros.setup_template('auditbeat', inventory_hostname, data_nodes, elasticsearch_beat_settings) }}
#============================== Setup ILM =====================================
# Configure Index Lifecycle Management Index Lifecycle Management creates a
# write alias and adds additional settings to the template.
# The elasticsearch.output.index setting will be replaced with the write alias
# if ILM is enabled.
# Enabled ILM support. Valid values are true, false, and auto. The beat will
# detect availabilty of Index Lifecycle Management in Elasticsearch and enable
# or disable ILM support.
#setup.ilm.enabled: auto
# Configure the ILM write alias name.
#setup.ilm.rollover_alias: "filebeat"
# Configure rollover index pattern.
#setup.ilm.pattern: "{now/d}-000001"
{% if ilm_policy_name is defined %}
setup.ilm.policy_name: "{{ ilm_policy_name }}"
{% endif %}
{% if ilm_policy_file_location is defined %}
setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}"
{% endif %}
#============================== Kibana =====================================
{% if (groups['kibana'] | length) > 0 %}
{{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }}