# add hosts in inventory to template survey

**URL:** <https://forum.ansible.com/t/add-hosts-in-inventory-to-template-survey/37076>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 7, 2022, 3:07pm UTC](https://forum.ansible.com/t/add-hosts-in-inventory-to-template-survey/37076 "2022-09-07T15:07:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill\_Biker](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bill_biker/32/8087_2.png) [@Bill\_Biker](https://forum.ansible.com/u/Bill_Biker)\
**Post date:** [September 7, 2022, 3:07pm UTC](https://forum.ansible.com/t/add-hosts-in-inventory-to-template-survey/37076/1 "2022-09-07T15:07:06Z")

</div>

Hello All,  
a couple of questions - any suggestions or methods or scripts that can add hosts  
in an AWX inventory to a template survey - NOT manually?

Question 2 : Is there a script - python or otherwise that will add hosts to an AWX inventory - aganin NOT manually.

It looks like in my case I will need a text file that has the desired hosts, and then a script  
reads the hosts and perhaps loads them in via the api.

Any suggestions are welcome.

Thanks,  
ewholz

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [September 9, 2022, 5:27pm UTC](https://forum.ansible.com/t/add-hosts-in-inventory-to-template-survey/37076/2 "2022-09-09T17:27:20Z")

</div>

Yes you can use awxkit or awx collection to add hosts from an inventory to a Job Template survey (it is possible to do via API, but these tools make this process easier and cleaner)

see this documentation for more information [https://docs.ansible.com/ansible/latest/collections/awx/awx/job\_template\_module.html#notes](https://docs.ansible.com/ansible/latest/collections/awx/awx/job_template_module.html#notes)

Let us know if this helps,

AWX Team

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [September 9, 2022, 5:29pm UTC](https://forum.ansible.com/t/add-hosts-in-inventory-to-template-survey/37076/3 "2022-09-09T17:29:19Z")

</div>

Why not use inventory sources for your inventory and pass on a inventory.ini?
