-
Notifications
You must be signed in to change notification settings - Fork 101
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
Please consider supporting os-client-config style clouds.yml files #350
Comments
Hi @JonTheNiceGuy, I agree it would be a good thing to support
I can't personally take time currently to work on that but pull requests are welcome. Also, you could currently read your 1 / I consider Create a python script #!/usr/bin/env python
import json
import os_client_config
cloud_config = os_client_config.OpenStackConfig().get_all_clouds()
config = {}
for cloud in cloud_config:
if cloud.name not in config:
config[cloud.name] = {}
config[cloud.name][cloud.region] = cloud.config
print(json.dumps(config, indent=4)) 2 / In your cloud_config = JSON.parse(`./generate-clouds-config.py`) then you can use this object to get configuration data. For instance, to get the authentication URL cloud_config[cloud][region]['auth']['auth_url'] Finally, here comes the full Vagrant.configure('2') do |config|
cloud = 'infra'
region = 'ORD'
cloud_config = JSON.parse(`./generate-clouds-config.py`)
auth = cloud_config[cloud][region]['auth']
config.vm.provider :openstack do |os|
os.openstack_auth_url = auth['auth_url']
os.tenant_name = auth['project_name']
os.username = auth['username']
os.password = auth['password']
os.region = region
os.server_name = ...
os.floating_ip_pool = ...
os.floating_ip_pool_always_allocate = ...
os.flavor = ...
os.image = ...
os.networks << ...
end
config.ssh.username = ...
end You should be able to switch from one cloud to another one changing only N.B.
|
This is awesome, thanks. I'll investigate it with my system and clouds.yml over the weekend... |
Any chance of ever seeing this happening? If clouds.yml could be supported the only thing needed for the user to specify wouldbe the tenant name, in fact not even that as the default one is the first one listed in the file. Current behavior forces users to put credentials into the Vagrantfile which means we cannot include it in the repository. |
Hi!
I'm about to start using this provider, but I was wondering whether it would be possible for you to consider using the os-client-config style files. These files are typically (on Linux at least) stored in ./clouds.y(a)ml, $HOME/.config/openstack/clouds.y(a)ml and /etc/openstack/clouds.y(a)ml. OS X and Windows have their own paths.
The format of these files is documented in https://docs.openstack.org/os-client-config/latest/user/configuration.html
The python library to load these files is here: https://github.com/openstack/os-client-config
Here's an example file (from the docs url above):
The text was updated successfully, but these errors were encountered: