# Ansible uri post after upgrade to 7.9.2

**URL:** <https://discuss.elastic.co/t/ansible-uri-post-after-upgrade-to-7-9-2/252724>\
**Category:** Elasticsearch\
**Created:** [October 20, 2020, 6:00pm UTC](https://discuss.elastic.co/t/ansible-uri-post-after-upgrade-to-7-9-2/252724 "2020-10-20T18:00:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [October 20, 2020, 6:00pm UTC](https://discuss.elastic.co/t/ansible-uri-post-after-upgrade-to-7-9-2/252724/1 "2020-10-20T18:00:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 17, 2020, 6:01pm UTC](https://discuss.elastic.co/t/ansible-uri-post-after-upgrade-to-7-9-2/252724/2 "2020-11-17T18:01:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
