Example #1
0
  public SSHConfig sshConfiguration() {
    if (this.sshConfig == null) {
      this.sshConfig = vagrant.execute(new GetSshConfig());
    }

    return this.sshConfig;
  }
Example #2
0
 public void rollback() {
   if (transactional) {
     vagrant.execute(new Rollback());
     return;
   }
   throw new IllegalArgumentException(
       "You have to create Vagrant object with transactional=true to use transactions.");
 }
Example #3
0
  public void ensureBoxExists(Box box) {
    for (String boxName : vagrant.execute(new ListBoxes())) {
      if (boxName.equals(box.getName())) {
        return;
      }
    }

    File oldWorkingDir = sh.getWorkingDir();
    try {
      sh.setWorkingDir(File.createTempFile("ignore", "").getParentFile());

      vagrant.execute(new AddBox(box));

      sh.setWorkingDir(oldWorkingDir);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
Example #4
0
 public VirtualMachineState state() {
   return vagrant.execute(new GetState());
 }
Example #5
0
 public void destroy() {
   vagrant.execute(new Destroy());
 }
Example #6
0
 public void halt() {
   vagrant.execute(new Halt());
 }
Example #7
0
 public void up() {
   vagrant.execute(new Up());
   if (transactional) vagrant.execute(new EnableSandbox(true));
 }
Example #8
0
 public void init() {
   vagrant.execute(new Init(definition.box().getName()));
 }