public class CreateUserStatements extends java.lang.Object
|Modifier and Type||Method and Description|
Returns the commands required to create the user, to be used for connecting (e.g.
public org.jclouds.domain.LoginCredentials credentials()
public java.util.List<org.jclouds.scriptbuilder.domain.Statement> statements()
public static CreateUserStatements get(JcloudsLocation location, @Nullable org.jclouds.compute.domain.Image image, ConfigBag config)
The returned login credentials may be null if we haven't done any user-setup and no specific
user was supplied (i.e. if
dontCreateUser was true and
user was null or blank).
In which case, the caller should use the jclouds node's login credentials.
There are quite a few configuration options. Depending on their values, the user-creation behaves differently:
dontCreateUsersays not to run any user-setup commands at all. If
useris non-empty (including with the default value), then that user will subsequently be used, otherwise the (inferred)
loginUserwill be used.
loginUserrefers to the existing user that jclouds should use when setting up the VM. Normally this will be inferred from the image (i.e. doesn't need to be explicitly set), but sometimes the image gets it wrong so this can be a handy override.
useris the username for brooklyn to subsequently use when ssh'ing to the machine. If not explicitly set, its value will default to the username of the user running brooklyn.
uservalue is null or empty, then the (inferred)
loginUserwill subsequently be used, setting up the password/authorizedKeys for that loginUser.
useris "root", then setup the password/authorizedKeys for root.
userequals the (inferred)
loginUser, then don't try to create this user but instead just setup the password/authorizedKeys for the user.
dontCreateUseris set, obviously).
publicKeyDatais the key to authorize (i.e. add to .ssh/authorized_keys), if not null or blank. Note the default is to use
~/.ssh/id_dsa.pubif either of those files exist for the user running brooklyn. Related is
publicKeyFile, which is used to populate publicKeyData.
passwordis the password to set for the user. If null or blank, then a random password will be auto-generated and set.
privateKeyDatais the key to use when subsequent ssh'ing, if not null or blank. Note the default is to use
~/.ssh/id_dsa. The subsequent preferences for ssh'ing are:
privateKeyDataif not null or blank (including if using default)
password(or the auto-generated password if that is blank).
grantUserSudodetermines whether or not the created user may run the sudo command.
image- The image being used to create the VM
config- Configuration for creating the VM