Hi i have update to closed thread -> How to Import a Kibana Dashboard with Ansible? . I have been able to solve that nicely - ansible way.
- name: Install custom dashboards
ansible.builtin.uri:
url: "{{ kibana_endpoint }}/api/saved_objects/_import?overwrite=true"
method: POST
body_format: form-multipart
body:
file:
filename: "{{ item }}.ndjson"
content: "{{ lookup('ansible.builtin.file', file_name_to_upload) }}"
mime_type: application/octet-stream
headers:
kbn-xsrf: "reporting"
validate_certs: yes
return_content: yes
user: "{{ kibana_user }}"
password: "{{ kibana_password }}"
force_basic_auth: yes
status_code: [ 200 ]
vars:
file_name_to_upload: "{{ item }}.ndjson"
loop: "{{ dashboards }}