I have been using ansible to manage templates and role mappings using the uri method similar to this:
- name: Post to elastic
uri:
url: "{{ cluster_uri }}/_template/{{ obj }}?pretty"
method: POST
body: "{{ lookup('file','files/templates/{{ obj }}.json') }}"
body_format: json
user: "{{ elastic.user }}"
password: "{{ elastic.pass }}"
validate_certs: no
delegate_to: localhost
run_once: true
This quit working when we upgraded from 7.6 to 7.9, failing with a 401 not authorized. Curl with the same creds worked. Adding "force_basic_auth: yes" to the method fixes the problem.
I can't find anything in breaking changes that might relate. I don't know if this is a bug in elasticsearch or some security improvement that requires the change.
Just getting the info here searchable here FYI