-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/cloudstack: Improve ssh keypair handling #5112
Conversation
serbaut
commented
Feb 12, 2016
- adds support for projects
- adds support for public_key strings as well as filenames
label: s/openstack/cloudstack/ |
@serbaut thanks for the PR! I just had a look at it, but I fail to understand why you added the As for the project ID stuff, I like the approach but think we should make it more generic by placing the After we done that, we can use the |
I added
I will regorg the code as per your suggestion and make a new pr. |
Ok, that's clear 😀 In that case I would suggest updating the logic behind the There is a way to do this which enables the param to take both content or a file path, so it will not break backwards compatibility and will allow both use cases to work with that single parameter. Have a look at this PR which implements this as well (the rename of the param is not needed in this case as we don't have Let me know if you need any help with it, but I guess it's pretty straight forward 😉 |
Having an interface that can take a string or a filename doesn't sound like a good practice. What if the file doesn't exists? You would get a strange error message instead of Why not make it compatible with |
This approach (having a single param that accepts both a string and a filename) is done in more places within TF (hence there is a dedicated helper package made for it) and gives the user maximum flexibility about how they want to build their TF config. Especially here were you only want to extend the way how you can input a value and not the logic behind the scenes (no other API calls or special treatment is needed in the resource provider code) or the purpose of the param (it still takes in a key), it makes a lot of sense to me to just add that option to the existing param by extending the inputs it allows. Next to that this option will be fully compatible with So still I'm not in favour of adding a separate param and the additional Last but not least using |
Cloudstack only accepts public keys in the OpenSSH format afaict. I fail to find any module that mentions a "string or filename" duality in the docs? |
- adds support for projects - adds support for public_key strings as well as filenames
LGTM! Thanks again for the PR! |
provider/cloudstack: Improve ssh keypair handling
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |