Awx: inventory from us-gov-east-1

Created on 27 Aug 2020  ยท  7Comments  ยท  Source: ansible/awx

ISSUE TYPE
  • Bug Report
SUMMARY

Unable to set region of GovCloud us east;
us-gov-east-1

ENVIRONMENT
  • AWX version: 14.0.0
  • AWX install method: docker on linux
  • Ansible version: 2.9.11
  • Operating System: Ubuntu
  • Web Browser: Chrome
STEPS TO REPRODUCE

Click \ Inventories \ sources \ Amazon EC2 \ Regions drop down does not have a US-EAST (GovCloud)

EXPECTED RESULTS

I expected it would have this option


I also cannot find any workaround. If I would set it to all it would fail

1.872 INFO     Updating inventory 2: test-east-us-gov
2.272 INFO     Reading Ansible inventory source: /tmp/awx_8_bny8y3fg/aws_ec2.yml
2.274 INFO     Using VIRTUAL_ENV: /var/lib/awx/venv/ansible
2.275 INFO     Using PATH: /var/lib/awx/venv/ansible/bin:/var/lib/awx/venv/awx/bin:/usr/pgsql-10/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2.275 INFO     Using PYTHONPATH: /var/lib/awx/venv/ansible/lib/python3.6/site-packages:

Traceback (most recent call last):
File "/var/lib/awx/venv/awx/bin/awx-manage", line 8, in
sys.exit(manage())
File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/__init__.py", line 154, in manage
execute_from_command_line(sys.argv)
File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(args, *cmd_options)
File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(args, *options)
File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/management/commands/inventory_import.py", line 1149, in handle
raise exc
File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/management/commands/inventory_import.py", line 1039, in handle
venv_path=venv_path, verbosity=self.verbosity).load()
File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/management/commands/inventory_import.py", line 215, in load
return self.command_to_json(base_args + ['--list'])
File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/management/commands/inventory_import.py", line 198, in command_to_json
self.method, proc.returncode, stdout, stderr))
RuntimeError: ansible-inventory failed (rc=1) with stdout:
stderr:
ansible-inventory 2.9.11
config file = /etc/ansible/ansible.cfg
configured module search path = ['/var/lib/awx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible-inventory
python version = 3.6.8 (default, Apr 16 2020, 01:36:27) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
Using /etc/ansible/ansible.cfg as config file
Could not connect to the endpoint URL: "https://ec2.us-east-1.amazonaws.com/"
File "/usr/lib/python3.6/site-packages/ansible/inventory/manager.py", line 280

api medium bug

All 7 comments

@chrismeyersfsu how would your plugin change affect this?

We are in the process of changing how this region would be passed, but we do want to ensure that it works.

Inventory plugins will now take data directly from source_vars and should be of the form documented in ansible https://docs.ansible.com/ansible/latest/plugins/inventory/aws_ec2.html#parameter-regions

plugin: aws_ec2
regions:
  - us-gov-east-1

I think this is better placed in needs_docs to update info about regions in https://docs.ansible.com/ansible-tower/latest/html/userguide/inventories.html#id2

@tvo318 ^

@elyezer seems like @tvo318 and @chrismeyersfsu maybe need to get together to make sure all inventory docs are updated because of merge of https://github.com/ansible/awx/pull/7763 for https://github.com/ansible/awx/issues/5150

https://github.com/ansible/awx/issues/5150#issuecomment-669495939 shows how to configure the source_vars to keep the previous behavior, expand the aws section there.

Also the docs https://docs.ansible.com/ansible/latest/plugins/inventory/aws_ec2.html#parameter-regions will provide how to set the various different options in case you want to change something.

yeah I think we just need to get that info into the tower docs

That information will be added to the docs

Was this page helpful?
0 / 5 - 0 ratings