forked from example42/psick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvagrant.py
47 lines (37 loc) · 1.13 KB
/
vagrant.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from fabric.api import *
@task
def all_status(env=''):
"""Run vagrant status on all the available environments"""
local( 'cd vagrant/environments ; for v in $(ls ' + str(env) + '); do cd $v ; echo "Vagrant environment: ${v}" ; echo ; vagrant status ; cd ../ ; echo ; done' )
@task
def status(vm=''):
"""Show status of the specified vm"""
local( 'vagrant/bin/vm.sh status ' + str(vm) )
@task
def suspend(vm):
"""Suspend the specified vm"""
local( 'vagrant/bin/vm.sh suspend ' + str(vm) )
@task
def resume(vm):
"""Resume the specified vm"""
local( 'vagrant/bin/vm.sh resume ' + str(vm) )
@task
def destroy(vm):
"""Destroy the specified vm"""
local( 'vagrant/bin/vm.sh destroy ' + str(vm) )
@task
def reload(vm):
"""Reload the specified vm"""
local( 'vagrant/bin/vm.sh reload ' + str(vm) )
@task
def provision(vm):
"""Run vagrant provision on the specified vm"""
local( 'vagrant/bin/vm.sh provision ' + str(vm) )
@task
def up(vm):
"""Vagrant up the specified vm"""
local( 'vagrant/bin/vm.sh up ' + str(vm) )
@task
def halt(vm):
"""Halts the the specified Vagrant vm"""
local( 'vagrant/bin/vm.sh halt' + str(vm) )