How do I Enable "want_hostcollections=true" for Red Hat Satellite 6 Inventory in Ansible Tower?
Environment
Ansible Tower <= 3.2.x
Issue
How do I enable "want_hostcollections=true" for Red Hat Satellite 6 Inventory in Ansible Tower?
Resolution
-
As of Ansible Tower 3.8, you can specify the plugin parameter
want_hostcollections: Truedirectly into the inventory source. More details on Content from docs.ansible.com is not included.want_hostcollections parameter. -
Download the latest foreman.ini file from ansible git repo in Tower server using the below link:
# cd /etc/ansible
# vim foreman.ini (now copy the contents from this [link](https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/foreman.ini))
# chmod 644 foreman.ini (we need to make sure that awx user can read it)
-
Change the values in the foreman.ini file with your credentials and other values that you want.
-
Create a Custom Script in Tower by following the below steps:
- From Settings click
INVENTORY SCRIPTS - Copy the contents from this Content from raw.githubusercontent.com is not included.link and paste it in
CUSTOM SCRIPT - Then, Click save.
- From Settings click
-
Now, create a new inventory and then navigate to
SOURCEStab. -
Choose
Custom Scriptfrom the dropdown list. -
Select the Custom Script that you created.
-
Lastly, add the path to foreman.ini path in
SOURCE VARIABLESlike below:
FOREMAN_INI_PATH: /etc/ansible/foreman.ini
-
After this please make sure the Job Isolation is off, you can switch that off by going to Settings -> Configure Tower -> Jobs tab, toggle off the job isolation.
-
Finally sync the inventory and see if it works.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.