You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hetzner-ansible/roles/kibana/tasks/_import_savedobjects.yml

34 lines
1.0 KiB
YAML

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

---
- name: "Importing kibana objects to <{{ shared_service_url_kibana }}>"
include_tasks: import_service_ojects.yml
loop: "{{ elastic_index_patterns }}"
loop_control:
label: "{{ elastic_index_pattern.id }}"
loop_var: elastic_index_pattern
when:
- elastic_index_patterns is defined
- name: "Setting default index pattern"
set_fact:
elastic_default_index: "{{ elastic_index_patterns | first | map(attribute='id') | to_uuid }}"
- name: "Setting default index to <{{ elastic_default_index }}>"
delegate_to: localhost
uri:
url: "{{ shared_service_url_kibana }}/s/{{ stage }}-{{ tenant_id }}/api/kibana/settings"
method: POST
status_code: [200]
user: "{{ elastic_admin_username }}"
password: "{{ elastic_admin_password }}"
force_basic_auth: yes
headers:
kbn-xsrf: true
body_format: json
body:
changes:
defaultIndex: "{{ elastic_default_index }}"
become: false
when:
- elastic_state == 'present'
- elastic_index_patterns is defined