I have access to ec2, Autoscalling ,S3 etc except for elastic search. So thats the issue then, I thought I shd be able to see ec2 insatnce as I tried adding tag filter too
I am now using IAM role attached to the ec2 where AWX is running. When I run docker exec 0de4d8a3f2a2 python2 /usr/lib/python2.7/site-packages/awx/plugins/inventory/ec2.py
in the awx_task container. I am getting all the data related to RDS and cache in format:
{
“Multiple”: [ //xxxxx.y9ryfm.cfg.use1.cache.amazonaws.com
],
“_meta”: {
“hostvars”: {
…
so on, all details on RDS.
When I try through the WEBUI, I get :
2017-12-13 20:10:01,187 INFO awx.main.commands.inventory_import Updating inventory 3: AWS HorizontalDev 2017-12-13 20:10:01,203 DEBUG awx.main.commands.inventory_import Using system install of ansible-inventory CLI: /usr/bin/ansible-inventory 2017-12-13 20:10:01,203 INFO awx.main.commands.inventory_import Reading Ansible inventory source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/ec2.py 2017-12-13 20:10:02,912 ERROR awx.main.commands.inventory_import [WARNING]: Could not match supplied host pattern, ignoring: all 2017-12-13 20:10:02,913 ERROR awx.main.commands.inventory_import 2017-12-13 20:10:02,913 INFO awx.main.commands.inventory_import Processing JSON output… 2017-12-13 20:10:02,913 DEBUG awx.main.commands.inventory_import Loaded group: all 2017-12-13 20:10:02,913 DEBUG awx.main.commands.inventory_import Finished loading from source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/ec2.py 2017-12-13 20:10:02,913 INFO awx.main.commands.inventory_import Loaded 0 groups, 0 hosts 2017-12-13 20:10:02,923 INFO awx.main.commands.inventory_import Inventory variables unmodified 2017-12-13 20:10:02,929 DEBUG awx.main.models.inventory Going to update inventory computed fields 2017-12-13 20:10:02,991 DEBUG awx.main.models.inventory Finished updating inventory computed fields 2017-12-13 20:10:02,991 INFO awx.main.commands.inventory_import Inventory import completed for AWS in 1.8s
In Inventory , I have configured only source now and not groups & hosts.
there is no ec2.ini in /usr/lib/python2.7/site-packages/awx/plugins/inventory/ where ec2.py is called in the awx_task container. I added there manually to run ec2.py script from docker thru cli as it was giving this error in absence of ec2.ini:
Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/awx/plugins/inventory/ec2.py”, line 1573, in
Ec2Inventory()
File “/usr/lib/python2.7/site-packages/awx/plugins/inventory/ec2.py”, line 180, in init
self.read_settings()
File “/usr/lib/python2.7/site-packages/awx/plugins/inventory/ec2.py”, line 251, in read_settings
configRegions = config.get(‘ec2’, ‘regions’)
File “/usr/lib64/python2.7/ConfigParser.py”, line 607, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: ‘ec2’