REST API to add host to inventory for Ansible Tower is Not working!

263 views
Skip to first unread message

Vivek Mandal

unread,
Apr 17, 2020, 9:40:27 AM4/17/20
to Ansible Project
Hi,
I have been trying to execute a REST API to
Add a host to an inventory.Below is the API.

/api/v2/inventories/{id}/hosts/

Unfortunately, This API doesn't work. It gives the response as 200(Ok). But only displays the existing host. Its the same response when you run GET method for the same API call. Can someone please help me rectifying the error.

Thanks,
Vivek

Stefan Hornburg (Racke)

unread,
Apr 17, 2020, 10:01:08 AM4/17/20
to ansible...@googlegroups.com
Hello Vivek,

this list is for Ansible only, not for Tower or AWX.

Please contact Redhat support.

Regards
Racke

--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc

Phil Griffiths

unread,
Apr 20, 2020, 1:03:57 PM4/20/20
to Ansible Project
Hi Vivek

As Stefan mentioned this list is not for AWX/Tower queries, BUT please take a look at either the tower-cli or awx-cli depending on your version and also the tower specific modules for doing such tasks. For instance, https://docs.ansible.com/ansible/latest/modules/tower_host_module.html#tower-host-module

Regards
Phil.
Reply all
Reply to author
Forward
0 new messages