Package org.jclouds.scriptbuilder.domain

Examples of org.jclouds.scriptbuilder.domain.StatementList


      /**
       * @see InitScript#getRun()
       */
      public Builder run(Iterable<Statement> run) {
         this.run = new StatementList(checkNotNull(run, "run"));
         return this;
      }
View Full Code Here


      /**
       * @see InitScript#getInit()
       */
      public Builder init(Statement init) {
         this.init = new StatementList(checkNotNull(init, "init"));
         return this;
      }
View Full Code Here

      /**
       * @see InitScript#getInit()
       */
      public Builder init(Statement... init) {
         this.init = new StatementList(checkNotNull(init, "init"));
         return this;
      }
View Full Code Here

      /**
       * @see InitScript#getInit()
       */
      public Builder init(Iterable<Statement> init) {
         this.init = new StatementList(checkNotNull(init, "init"));
         return this;
      }
View Full Code Here

      statements.add(exec("{md} " + sshDir));
      String idRsa = sshDir + "{fs}id_rsa";
      statements.add(exec("{rm} " + idRsa));
      statements.add(appendFile(idRsa, Splitter.on('\n').split(privateKey)));
      statements.add(exec("chmod 600 " + idRsa));
      return new StatementList(statements.build()).render(family);
   }
View Full Code Here

      Builder<Statement> statements = ImmutableList.builder();
      statements.add(exec("mkdir -p " + sshDir));
      String authorizedKeys = sshDir + "{fs}authorized_keys";
      statements.add(appendFile(authorizedKeys, Splitter.on('\n').split(Joiner.on("\n\n").join(publicKeys))));
      statements.add(exec("chmod 600 " + authorizedKeys));
      return new StatementList(statements.build()).render(family);
   }
View Full Code Here

            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

         // the sha512 line breaks in both awk and sed during an inline
         // expansion. unfortunately, we have to save a temp file. In this case,
         // somewhat avoiding collisions by naming the file .user, conceding it
         // isn't using any locks to prevent overlapping changes
         Statement replaceShadowFile = exec(format("test -f %2$s.%1$s && mv %2$s.%1$s %2$s", login, shadowFile));
         return new StatementList(ImmutableList.of(replaceEntryInTempFile, replaceShadowFile)).render(family);
      } catch (Exception e) {
         propagate(e);
         return null;
      }
   }
View Full Code Here

      if (config.shouldLockSsh())
         statements.add(lockSshd());
      if (config.shouldResetLoginPassword()) {
         statements.add(resetLoginUserPasswordTo(config.getCryptFunction(), config.getLoginPassword()));
      }
      return new StatementList(statements.build()).render(family);
   }
View Full Code Here

      }

      String strOptions = Joiner.on(' ').withKeyValueSeparator(" ").join(options.build());
      statements.add(Statements.exec(String.format("chef-solo %s", strOptions)));

      return new StatementList(statements.build()).render(family);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.scriptbuilder.domain.StatementList

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.