-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inventory Source for Openstack does not have a region field #5080
Comments
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. |
I've got the same issue whith AWX 13.0.0 and my OVH Public Cloud |
@chrismeyersfsu @elyezer seems like this should be cleared up by your recent changes? |
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. |
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? |
Inspired by https://github.com/openstack/ansible-collections-openstack/blob/master/scripts/inventory/openstack.yml, here is my necessary file: clouds:
devstack:
auth:
auth_url: <OS_AUTH_URL>
username: <OS_USERNAME>
password: <OS_PASSWORD>
project_name: <OS_TENANT_NAME>
project_domain_name: <OS_USER_DOMAIN_NAME>
user_domain_name: <OS_USER_DOMAIN_NAME>
private: true
verify: true
region_name: GRA3 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), Checked manually by this way:
|
Hello all, I did some changes in code and it works : File generated: clouds:
devstack:
auth:
auth_url: http://localhost
domain_name: domain_name
password: password
project_domain_name: project_domain_name
project_name: tenant_name
username: utilisateur
private: true
region_name: myregion
verify: true But I don't know how to submit my changes :'( @ryanpetrello : What do you thing ? Can you help me ? |
PR: #8880 |
…ield_missing Related #5080 openstack region field missing Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
cc @unlikelyzero I put this in |
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. |
@akus062381 can you just check to see if the field appears in the UI? Not tests needed |
The region field appears in the details screen for the credential. Verified manually. |
…it_reaper Add a periodic task to reap unreleased receptor work units
ISSUE TYPE
SUMMARY
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.
ENVIRONMENT
STEPS TO REPRODUCE
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):
EXPECTED RESULTS
Part 1:
A Region field should be present.
Part 2:
The YML be added to the generated YML, and for data to be collected from the correct region, rather than the default
ACTUAL RESULTS
Part 1:
No region field is present
Part 2:
The Generated YML appears not to include the region_name key, but it does include any vars included under the
ansible:
key.ADDITIONAL INFORMATION
The example at https://github.com/ansible/ansible/blob/devel/contrib/inventory/openstack.yml does not include a region for Openstack, but the code at https://github.com/ansible/ansible/blob/devel/contrib/inventory/openstack_inventory.py does make references to a
region
variable.The text was updated successfully, but these errors were encountered: