dynamic inventory doesn't use username/password env variables
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ansible-collections-openstack |
New
|
Undecided
|
Unassigned |
Bug Description
Using a rather minimal inventory configuration, the dynamic inventory reads the clouds.yaml as intended, but doesn't use the OS_USERNAME/
We are using the same credentials for multiple accounts, and don't want to specify them for each cloud separately but rather once for all of them (and in a secure way, thus the environment variables).
dynamic inventory / openstack.yaml
=======
plugin: openstack.
all_projects: false
expand_hostvars: true
fail_on_errors: true
strict: true
keyed_groups:
- key: openstack.tags
separator: ""
clouds.yaml
==========
clouds:
example-
auth:
auth_url: https:/
project_name: example-project
domain_name: Default
region_name: "ZH"
interface: "public"
identity_
example-
auth:
auth_url: https:/
project_name: example-project
domain_name: Default
region_name: "LS"
interface: "public"
identity_
Give the above configurations, and the username & password set using the environment variables, the openstack CLI is able to fetch projects and servers as intended (eg. openstack --os-cloud example-region-ls server list ), but the dynamic inventory fails with the following error.
Traceback (most recent call last):
File "$HOME/
sys.
^^^^^^
File "$HOME/
output = inventory.
File "$HOME/
for server in cloud.list_servers(
File "$HOME/
for server in self.compute.
File "$HOME/
proxy = self._make_
File "$HOME/
found_version = temp_adapter.
File "$HOME/
return self.session.
File "$HOME/
return auth.get_
File "$HOME/
data = get_endpoint_
File "$HOME/
service_catalog = self.get_
File "$HOME/
self.auth_ref = self.get_
File "$HOME/
return self._plugin.
File "$HOME/
resp = session.
File "$HOME/
return self.request(url, 'POST', **kwargs)
File "$HOME/
raise exceptions.
keystoneauth1.
Failed validating 'type' in schema[
{'type': 'string'}
On instance[
None (HTTP 400) (Request-ID: req-....)