I built a bit of automation off of the AWX\ec2 inventory capability. Trouble is that AWX inventory ec2 source lookup has not been incorporating newer AWS regions (8 or 9 at this point) due to boto related stuff and things (I just bumped into the issue in Govcloud east).
I know there is an open issue on this https://github.com/ansible/awx/issues/2115 but it is unclear if\when the fix will be in. I was wondering if there is any workaround I could use to retain the dynamic functionality or if anybody knows timeline of fix? I have googled around and been unable to fix with what I have found
TIA
Hi Thomas,
If the root issue is the boto version, have you tried creating a custom venv w/ the version of boto you need? After creating the venv, you could use that to run your inventory imports:
https://docs.ansible.com/ansible-tower/latest/html/upgrade-migration-guide/virtualenv.html#using-virtualenv-with-at
-Jim
Thanks for the help but I have been unable to get dynamic lookup of objects in the new regions to work. I have tried working with boto to boto3 switchout in requirements pre-install, switching out info in endpoints.json, where how to set endpoints_path use_endpoint_heuristics on the AWX containers. In other words all over the map Am no closer to figuring out how to use ec2 inventory when addressing the newer regions.
I will keep noodling on it but it might be easier to just refactor off of using the ec2 dynamic inventory, until such time that the new regions are incorporated as a matter of course. I am using AWX rather then Tower so maybe there is a difference there.
Thanks again for the follow-up
Thomas,
Not sure if I ever asked / saw you mention, but… what version of awx are you on? If you’re on an older version, you’d be using the old aws inventory script. Never versions use the inventory plugin. (The old scripts are being deprecated in awx in short order - in fact, we just removed them from the latest awx release). I’m wondering which version of the inventory update mechanism you’re seeing this issue with.
-Jim
Sorry for the late reply, busy day. I was testing on AWX 12.0.0 and below till today
Upgraded my test instance to 13.0.0 today and am able to dynamically pull from Paris, Bahrain, Milan etc etc. Previously the global lookup was not finding instances in new regions with the instance filter tag I set, whereas it could find instances tagged in “older” regions. So the update fixed the primary worry I had
I still get an error with Govcloud us-east-1 when I leave “Amazon EC2” region blank (Separate issue that sent me down this path), rather then picking US West Govcloud which works fine, but I think that has to do with STS endpoints blah blah and I can live with it for now.
[WARNING]: * Failed to parse /tmp/awx_136_99qkcqi8/aws_ec2.yml with auto
plugin: An error occurred (AuthFailure) when calling the DescribeRegions
operation: AWS was not able to validate the provided access credentials
Thanks for your help with this, hope you have good rest of the week and weekend