[
https://issues.apache.org/jira/browse/JCLOUDS-670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14097738#comment-14097738
]
Ignasi Barrera commented on JCLOUDS-670:
----------------------------------------
Yes, that would override the username.
To give a bit of context: jclouds will use by default the credentials bound to
the node. Some apis populate them and some don't expose that information, so
jclouds provides a way to explicitly set the credentials to use, with the
"overrideLoginCredentials" method in the TemplateOptions and RunScriptOptions.
This is how, conceptually, credentials are configured in jclouds, and
improvements to that IMO should not add different paths or "shorcuts" in
provider specific options. This increases the complexity of the apis and makes
jclouds as a whole more difficult to use. If there is already a
generic/portable mechanism to do something, let's try to keep it and use it.
Having said this, I'm not against your PR (honestly, issues opened with a PR
are highly appreciated!), but if needed I'd consider a way to do the same in
the generic options, not in the provider specific ones.
Anyway, you should be able to achieve what you want by making two calls to the
ComputeService: a first one create the nodes (without running anything in them)
and a second call to the "runScriptOnNode" method. This way you'll be able to
build the new LoginCredentials object with the right username extracted from
the node, and use it in this second call.
Thinking about it, the use case is to "partially override" the credentials. The
username is dynamic but the password must be forced. I don't know if such use
case should be modeled accordingly or separating the node creation from the
bootstrap is enough (I think so). In any case, it is not a use case particular
to nova and it should better be implemented (if needed) in the portable layer.
WDYT? (btw, thanks for the PR!)
> Option force no password when launching images on providers
> -----------------------------------------------------------
>
> Key: JCLOUDS-670
> URL: https://issues.apache.org/jira/browse/JCLOUDS-670
> Project: jclouds
> Issue Type: Improvement
> Reporter: Werner Buck
> Priority: Minor
>
> Images may return passwords from Nova. I have seen this happen with the
> official fedora openstack image as well as other times.
> When SSH is used to connect, the password from nova is used, which results in
> authentication errors while you might want to use the ssh-agent for
> authentication.
> To fix this I suggest the "forceNoPassword" option, to force the password to
> be empty even if we receive a password from the provider. This option is by
> default "false" and can be set in RunScriptOptions or TemplateOptions.
> Github: https://github.com/jclouds/jclouds/pull/486
--
This message was sent by Atlassian JIRA
(v6.2#6252)