Manage Kibana artefacts with Ansible

Hi!

Thanks for your reply - it made me investigate this a little further and I finally got it to work. What I did was:

- name: Remove Kibana space(s) if they already exist(s)
  ansible.builtin.uri:
    url: "http://{{ kibana_host }}:{{ kibana_port }}/api/spaces/space/{{ item.space | replace(' ','')  | lower }}"
    url_username: "{{ kibana_manage_environment_username }}"
    url_password: "{{ kibana_manage_environment_password }}"
    force_basic_auth: true
    status_code: 204
    headers:
      kbn-xsrf: true
      Content-Type: application/json
    method: DELETE
  loop: "{{ spaces }}"
  tags:
    - spaces

The key point here is that I removed everything certificate related and replaced them with force_basic_auth: true and status_code: 204 and they made the trick.

Again, many thanks!