Package org.jclouds.scriptbuilder.statements.ssh

Examples of org.jclouds.scriptbuilder.statements.ssh.AuthorizeRSAPublicKeys


      statements.add(Statements.exec(String.format("useradd %s %s", options, login)));

      if (authorizeRSAPublicKeys.size() > 0 || installRSAPrivateKey != null) {
         String sshDir = homeDir + "{fs}.ssh";
         if (authorizeRSAPublicKeys.size() > 0)
            statements.add(new AuthorizeRSAPublicKeys(sshDir, authorizeRSAPublicKeys));
         if (installRSAPrivateKey != null)
            statements.add(new InstallRSAPrivateKey(sshDir, installRSAPrivateKey));
      }
      statements.add(Statements.exec(String.format("chown -R %s %s", login, homeDir)));
      return new StatementList(statements.build()).render(family);
View Full Code Here


   @Override
   public Statement apply(TemplateOptions options) {
      List<Statement> bootstrap = newArrayList();
      if (options.getPublicKey() != null)
         bootstrap.add(new AuthorizeRSAPublicKeys(ImmutableSet.of(options.getPublicKey())));
      if (options.getRunScript() != null)
         bootstrap.add(options.getRunScript());
      if (options.getPrivateKey() != null)
         bootstrap.add(new InstallRSAPrivateKey(options.getPrivateKey()));
      if (bootstrap.size() >= 1) {
View Full Code Here

      statements.add(Statements.exec(String.format("useradd %s %s", options, login)));

      if (authorizeRSAPublicKeys.size() > 0 || installRSAPrivateKey != null) {
         String sshDir = homeDir + "{fs}.ssh";
         if (authorizeRSAPublicKeys.size() > 0)
            statements.add(new AuthorizeRSAPublicKeys(sshDir, authorizeRSAPublicKeys));
         if (installRSAPrivateKey != null)
            statements.add(new InstallRSAPrivateKey(sshDir, installRSAPrivateKey));
      }
      statements.add(Statements.exec(String.format("chown -R %s %s", login, homeDir)));
      return new StatementList(statements.build()).render(family);
View Full Code Here

   @Override
   public Statement apply(TemplateOptions options) {
      List<Statement> bootstrap = newArrayList();
      if (options.getPublicKey() != null)
         bootstrap.add(new AuthorizeRSAPublicKeys(ImmutableSet.of(options.getPublicKey())));
      if (options.getRunScript() != null)
         bootstrap.add(options.getRunScript());
      if (options.getPrivateKey() != null)
         bootstrap.add(new InstallRSAPrivateKey(options.getPrivateKey()));
      if (bootstrap.size() >= 1) {
View Full Code Here

      statements.add(Statements.exec(String.format("useradd %s %s", options, login)));

      if (authorizeRSAPublicKeys.size() > 0 || installRSAPrivateKey != null) {
         String sshDir = homeDir + "{fs}.ssh";
         if (authorizeRSAPublicKeys.size() > 0)
            statements.add(new AuthorizeRSAPublicKeys(sshDir, authorizeRSAPublicKeys));
         if (installRSAPrivateKey != null)
            statements.add(new InstallRSAPrivateKey(sshDir, installRSAPrivateKey));
      }
      statements.add(Statements.exec(String.format("chown -R %s %s", login, homeDir)));
      return new StatementList(statements.build()).render(family);
View Full Code Here

      statements.add(Statements.exec(String.format("useradd %s %s", options, login)));

      if (!authorizeRSAPublicKeys.isEmpty() || installRSAPrivateKey != null) {
         String sshDir = homeDir + "{fs}.ssh";
         if (!authorizeRSAPublicKeys.isEmpty())
            statements.add(new AuthorizeRSAPublicKeys(sshDir, authorizeRSAPublicKeys));
         if (installRSAPrivateKey != null)
            statements.add(new InstallRSAPrivateKey(sshDir, installRSAPrivateKey));
      }
      statements.add(Statements.exec(String.format("chown -R %s %s", login, homeDir)));
      return new StatementList(statements.build()).render(family);
View Full Code Here

   @Override
   public Statement apply(TemplateOptions options) {
      List<Statement> bootstrap = newArrayList();
      if (options.getPublicKey() != null)
         bootstrap.add(new AuthorizeRSAPublicKeys(ImmutableSet.of(options.getPublicKey())));
      if (options.getRunScript() != null)
         bootstrap.add(options.getRunScript());
      if (options.getPrivateKey() != null)
         bootstrap.add(new InstallRSAPrivateKey(options.getPrivateKey()));
      if (bootstrap.size() >= 1) {
View Full Code Here

TOP

Related Classes of org.jclouds.scriptbuilder.statements.ssh.AuthorizeRSAPublicKeys

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.