Package org.jclouds.scriptbuilder.statements.ssh

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


      ImmutableList.Builder<Statement> builder = ImmutableList.builder();
      if (options.getRunScript() != null) {
         builder.add(options.getRunScript());
      }
      if (options.getPrivateKey() != null) {
         builder.add(new InstallRSAPrivateKey(options.getPrivateKey()));
      }

      ImmutableList<Statement> bootstrap = builder.build();
      if (!bootstrap.isEmpty()) {
         if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript)) {
View Full Code Here


      ImmutableList.Builder<Statement> builder = ImmutableList.builder();
      if (options.getRunScript() != null) {
         builder.add(options.getRunScript());
      }
      if (options.getPrivateKey() != null) {
         builder.add(new InstallRSAPrivateKey(options.getPrivateKey()));
      }

      ImmutableList<Statement> bootstrap = builder.build();
      if (!bootstrap.isEmpty()) {
         if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript)) {
View Full Code Here

      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

      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) {
         if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript))
            options.nameTask("bootstrap");
         return bootstrap.size() == 1 ? bootstrap.get(0) : new StatementList(bootstrap);
      }
View Full Code Here

      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

      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) {
         if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript))
            options.nameTask("bootstrap");
         return bootstrap.size() == 1 ? bootstrap.get(0) : new StatementList(bootstrap);
      }
View Full Code Here

      ImmutableList.Builder<Statement> builder = ImmutableList.builder();
      if (options.getRunScript() != null) {
         builder.add(options.getRunScript());
      }
      if (options.getPrivateKey() != null) {
         builder.add(new InstallRSAPrivateKey(options.getPrivateKey()));
      }

      ImmutableList<Statement> bootstrap = builder.build();
      if (!bootstrap.isEmpty()) {
         if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript)) {
View Full Code Here

      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

      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

      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) {
         if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript))
            options.nameTask("bootstrap");
         return bootstrap.size() == 1 ? bootstrap.get(0) : new StatementList(bootstrap);
      }
View Full Code Here

TOP

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

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.