You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inventory Source for Openstack does not have a region field #5080
When creating an Openstack Credential, no field is provided to specify the region of the cluster. This results in Openstack using the default cluster. Additionally, specifying a region_name in the source variables section of the inventory source page does not work.
Part 1:
Go to Credentials. Hit Green Plus. Select OpenStack as Credential Type
Part 2:
Go to Existing Inventory. Select Sources tab. Hit Green Plus. Fill in name, select Openstack as Source. In source Variables, include the following (I wanted to try everything):
I might just be using the wrong variable - I've also just tried source_regions as referenced in awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js, but again no luck. I noticed that openstack isn't referenced, but GCE, AWS, Azure etc are, so this might be an easy fix.
It's been a while since I last looked at this, but IIRC it did only use the default region at the time. We're no longer using OpenStack, so it's not too practical for me to test. But if all regions are returned, and regions are groupable, that seems like a good compromise. @vguillard are all vm's in all regions getting returned for you, or just for the default region?
@vCra, I've got instances only in one region (GRA3),
There is other region but I can't login.
I can only list instances in one region.
I don't know what is the default region, sorry
api tests were added with the PR that are more than sufficient to test the api changes related to this PR. Going to call this good from the API perspective.
Activity
vCra commentedon Oct 28, 2019
I might just be using the wrong variable - I've also just tried source_regions as referenced in awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js, but again no luck. I noticed that openstack isn't referenced, but GCE, AWS, Azure etc are, so this might be an easy fix.
vguillard commentedon Sep 8, 2020
I've got the same issue whith AWX 13.0.0 and my OVH Public Cloud
ryanpetrello commentedon Sep 8, 2020
@chrismeyersfsu @elyezer seems like this should be cleared up by your recent changes?
#5150
#7763
chrismeyersfsu commentedon Sep 8, 2020
Looks like the Ansible OpenStack inventory plugin configuration doesn't support region as a parameter https://docs.ansible.com/ansible/latest/plugins/inventory/openstack.html Thus, our transition to inventory plugins will not solve your problem. All hosts in all regions will be returned. However, I think you can still accomplish the end goal of filtering or grouping by region using inventory plugins constructed feature. https://docs.ansible.com/ansible/latest/plugins/inventory/constructed.html
Your inventory will still contain all hosts in all regions but you can use the limit feature on job templates to reference particular regions.
vCra commentedon Sep 8, 2020
It's been a while since I last looked at this, but IIRC it did only use the default region at the time. We're no longer using OpenStack, so it's not too practical for me to test. But if all regions are returned, and regions are groupable, that seems like a good compromise. @vguillard are all vm's in all regions getting returned for you, or just for the default region?
vguillard commentedon Sep 9, 2020
Inspired by https://github.com/openstack/ansible-collections-openstack/blob/master/scripts/inventory/openstack.yml, here is my necessary file:
region_name is not written by AWX.
I've hardcoded 'region_name' in awx/main/models/credential/injectors.py (in devel branch):
It works, my instances are listed by AWX.
@vCra, I've got instances only in one region (GRA3),
There is other region but I can't login.
I can only list instances in one region.
I don't know what is the default region, sorry
Checked manually by this way:
vguillard commentedon Oct 4, 2020
Hello all,
I did some changes in code and it works :
In the UI:

File generated:
But I don't know how to submit my changes :'(
And I don't know if I should submit my changes.
@ryanpetrello : What do you thing ? Can you help me ?
vguillard commentedon Dec 13, 2020
PR: #8880
Merge pull request #8880 from vguillard/issue_5080_openstack_region_f…
ryanpetrello commentedon Jan 8, 2021
cc @unlikelyzero I put this in
needs_testso we can track itkdelee commentedon Jan 26, 2021
api tests were added with the PR that are more than sufficient to test the api changes related to this PR. Going to call this good from the API perspective.
unlikelyzero commentedon Mar 5, 2021
@akus062381 can you just check to see if the field appears in the UI? Not tests needed
akus062381 commentedon Mar 8, 2021
The region field appears in the details screen for the credential. Verified manually.
Merge pull request ansible#5080 from fosterseth/fix_a9154_receptor_un…