public SSHConfig sshConfiguration() { if (this.sshConfig == null) { this.sshConfig = vagrant.execute(new GetSshConfig()); } return this.sshConfig; }
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."); }
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); } }
public VirtualMachineState state() { return vagrant.execute(new GetState()); }
public void destroy() { vagrant.execute(new Destroy()); }
public void halt() { vagrant.execute(new Halt()); }
public void up() { vagrant.execute(new Up()); if (transactional) vagrant.execute(new EnableSandbox(true)); }
public void init() { vagrant.execute(new Init(definition.box().getName())); }