# Run Http GET from Ansible to remote server by connecting via localhost

**URL:** <https://discuss.elastic.co/t/run-http-get-from-ansible-to-remote-server-by-connecting-via-localhost/307233>\
**Category:** Elasticsearch\
**Created:** [June 15, 2022, 7:55am UTC](https://discuss.elastic.co/t/run-http-get-from-ansible-to-remote-server-by-connecting-via-localhost/307233 "2022-06-15T07:55:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlot\_Attard](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@charlot\_Attard](https://discuss.elastic.co/u/charlot_Attard)\
**Post date:** [June 15, 2022, 7:55am UTC](https://discuss.elastic.co/t/run-http-get-from-ansible-to-remote-server-by-connecting-via-localhost/307233/1 "2022-06-15T07:55:03Z")

</div>

Hello,

I am creating an ansible-playbook which is doing HTTP GET to a remote elastic server. The problem is that this ES server doesn't accept any other connection apart from localhost. Is there a way how to connect to the remote ES server and execute the curl command with localhost ?

```
- name: check current version
  uri: url=http://localhost:{{ es_http_port }} method=GET
  register: version_found
  retries: 10
  delay: 10
```

---

<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:** [July 13, 2022, 7:55am UTC](https://discuss.elastic.co/t/run-http-get-from-ansible-to-remote-server-by-connecting-via-localhost/307233/2 "2022-07-13T07:55:13Z")

</div>

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