Package org.platformlayer.ops

Examples of org.platformlayer.ops.OpsTarget.executeCommand()


        target.executeCommand("cat {0} | sudo -H -u gitosis gitosis-init", publicKeyFile);

        target.setFileContents(authorizedKeys, publicKeyData);
        target.executeCommand("chown -R {0} {1}", adminUser, adminSshDir);
        target.executeCommand("chmod -R 600 {0}", adminSshDir);
        target.executeCommand("chmod 700 {0}", adminSshDir);

        target.executeCommand("chsh -s /bin/bash {0}", adminUser);

        SshKey adminSshKey = new SshKey(null, adminUser, KeyPairUtils.deserialize(privateKeyData));
View Full Code Here


        target.executeCommand("cat {0} | sudo -H -u gitosis gitosis-init", publicKeyFile);

        target.setFileContents(authorizedKeys, publicKeyData);
        target.executeCommand("chown -R {0} {1}", adminUser, adminSshDir);
        target.executeCommand("chmod -R 600 {0}", adminSshDir);
        target.executeCommand("chmod 700 {0}", adminSshDir);

        target.executeCommand("chsh -s /bin/bash {0}", adminUser);

        SshKey adminSshKey = new SshKey(null, adminUser, KeyPairUtils.deserialize(privateKeyData));
View Full Code Here

        target.setFileContents(authorizedKeys, publicKeyData);
        target.executeCommand("chown -R {0} {1}", adminUser, adminSshDir);
        target.executeCommand("chmod -R 600 {0}", adminSshDir);
        target.executeCommand("chmod 700 {0}", adminSshDir);

        target.executeCommand("chsh -s /bin/bash {0}", adminUser);

        SshKey adminSshKey = new SshKey(null, adminUser, KeyPairUtils.deserialize(privateKeyData));

        OpsTarget adminTarget = machine.getTarget(adminSshKey);
        {
View Full Code Here

        SshKey adminSshKey = new SshKey(null, adminUser, KeyPairUtils.deserialize(privateKeyData));

        OpsTarget adminTarget = machine.getTarget(adminSshKey);
        {
            ProcessExecution execution = adminTarget.executeCommand("ssh-keyscan 127.0.0.1");
            File knownHosts = new File(adminSshDir, "known_hosts");
            adminTarget.setFileContents(knownHosts, execution.getStdOut());
        }

        // adminTarget.executeCommand("git clone gitosis@127.0.0.1:gitosis-admin.git /home/gitadmin/gitosis-admin");
View Full Code Here

    }

    FileUpload.upload(target, new File("/etc/hostname"), hostname);

    {
      ProcessExecution execution = target.executeCommand("hostname");
      String currentHostname = execution.getStdOut().trim();
      if (!currentHostname.equals(hostname)) {
        if (!DetectVirtualization.isLxc(target)) {
          // This actually can't be done within an LXC instance, which is why we go to extraordinary lengths
          // to
View Full Code Here

      if (!currentHostname.equals(hostname)) {
        if (!DetectVirtualization.isLxc(target)) {
          // This actually can't be done within an LXC instance, which is why we go to extraordinary lengths
          // to
          // set it on creation
          target.executeCommand("hostname {0}", hostname);
        } else {
          log.warn("Unable to change hostname on LXC: " + currentHostname + " -> " + hostname);
        }
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.