diff options
| author | Zuul <zuul@review.opendev.org> | 2026-05-06 14:10:20 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2026-05-06 14:10:20 +0000 |
| commit | 67383803aa233e2b7ddc065cd572c90ee2139d25 (patch) | |
| tree | ca934cdf5307f28d918cb3c159311f1d2bc04cea /ansible | |
| parent | 3e85c8ef6eb28f1def0309cfc051966c4b98f57a (diff) | |
| parent | 20c6740bfc8245a304e8d2a7f630269c31e3918f (diff) | |
| download | kolla-ansible-67383803aa233e2b7ddc065cd572c90ee2139d25.tar.gz kolla-ansible-67383803aa233e2b7ddc065cd572c90ee2139d25.zip | |
Merge "opensearch: automate index pattern creation in dashboards"
Diffstat (limited to 'ansible')
| -rw-r--r-- | ansible/roles/opensearch/tasks/post-config.yml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ansible/roles/opensearch/tasks/post-config.yml b/ansible/roles/opensearch/tasks/post-config.yml index f35b36f78..290e88365 100644 --- a/ansible/roles/opensearch/tasks/post-config.yml +++ b/ansible/roles/opensearch/tasks/post-config.yml @@ -87,3 +87,30 @@ when: - not ansible_check_mode - opensearch_retention_policy_check.status == 404 + +- name: Create OpenSearch Dashboards Index Pattern + become: true + kolla_toolbox: + container_engine: "{{ kolla_container_engine }}" + module_name: uri + module_args: + url: "{{ opensearch_dashboards_internal_endpoint }}/api/saved_objects/index-pattern/{{ opensearch_log_index_prefix }}-pattern" + method: POST + status_code: 200, 409 + url_username: "{{ opensearch_dashboards_user }}" + url_password: "{{ opensearch_dashboards_password }}" + force_basic_auth: true + headers: + osd-xsrf: "true" + body: + attributes: + title: "{{ opensearch_log_index_prefix }}-*" + timeFieldName: "@timestamp" + body_format: json + ca_path: "{{ openstack_cacert }}" + register: opensearch_index_pattern_create + changed_when: opensearch_index_pattern_create.status == 200 + delegate_to: "{{ groups['opensearch'][0] }}" + run_once: true + when: + - not ansible_check_mode |
