vagabond 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +12 -0
- data/README.md +48 -48
- data/USAGE.md +197 -0
- data/bin/vagabond +24 -2
- data/lib/vagabond/actions/create.rb +14 -5
- data/lib/vagabond/actions/destroy.rb +10 -8
- data/lib/vagabond/actions/freeze.rb +2 -1
- data/lib/vagabond/actions/provision.rb +6 -3
- data/lib/vagabond/actions/rebuild.rb +6 -5
- data/lib/vagabond/actions/ssh.rb +3 -2
- data/lib/vagabond/actions/start.rb +2 -1
- data/lib/vagabond/actions/status.rb +19 -3
- data/lib/vagabond/actions/thaw.rb +2 -1
- data/lib/vagabond/actions/up.rb +16 -3
- data/lib/vagabond/constants.rb +36 -0
- data/lib/vagabond/cookbooks/lxc/libraries/lxc.rb +5 -4
- data/lib/vagabond/cookbooks/lxc/metadata.rb +2 -2
- data/lib/vagabond/cookbooks/lxc/providers/container.rb +0 -1
- data/lib/vagabond/cookbooks/vagabond/attributes/default.rb +5 -0
- data/lib/vagabond/cookbooks/vagabond/recipes/default.rb +32 -9
- data/lib/vagabond/helpers/cheffile_loader.rb +20 -0
- data/lib/vagabond/helpers.rb +66 -1
- data/lib/vagabond/internal_configuration.rb +43 -19
- data/lib/vagabond/kitchen.rb +311 -0
- data/lib/vagabond/knife.rb +22 -17
- data/lib/vagabond/server.rb +42 -32
- data/lib/vagabond/vagabond.rb +147 -55
- data/lib/vagabond/vagabondfile.rb +31 -6
- data/lib/vagabond/version.rb +1 -1
- data/vagabond.gemspec +3 -0
- metadata +54 -4
- data/lib/vagabond/commands.rb +0 -87
- data/lib/vagabond/config.rb +0 -7
data/lib/vagabond/commands.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
require 'mixlib/cli'
|
2
|
-
require 'chef/log'
|
3
|
-
require 'vagabond/config'
|
4
|
-
require 'vagabond/vagabond'
|
5
|
-
require 'vagabond/server'
|
6
|
-
require 'vagabond/knife'
|
7
|
-
|
8
|
-
module Vagabond
|
9
|
-
class Commands
|
10
|
-
|
11
|
-
include Mixlib::CLI
|
12
|
-
|
13
|
-
DEFAULT_ACTIONS = Actions.constants.map do |konst|
|
14
|
-
const = Actions.const_get(konst)
|
15
|
-
const.public_instance_methods(false) if const.is_a?(Module)
|
16
|
-
end.flatten.sort
|
17
|
-
|
18
|
-
banner(
|
19
|
-
(
|
20
|
-
%w(Nodes:) + DEFAULT_ACTIONS.map{ |cmd|
|
21
|
-
"\tvagabond #{cmd} NODE [options]"
|
22
|
-
}.compact + %w(Server:) + (DEFAULT_ACTIONS + Server.public_instance_methods(false)).sort.map{ |cmd|
|
23
|
-
next if cmd == 'server'
|
24
|
-
"\tvagabond server #{cmd} [options]"
|
25
|
-
}.compact + ['Knife:', "\tvagabond knife COMMAND [knife_options]"] + %w(Options:)
|
26
|
-
).join("\n")
|
27
|
-
)
|
28
|
-
|
29
|
-
option(:force_solo,
|
30
|
-
:long => '--force-configure',
|
31
|
-
:boolean => true,
|
32
|
-
:default => false
|
33
|
-
)
|
34
|
-
|
35
|
-
option(:disable_solo,
|
36
|
-
:long => '--disable-configure',
|
37
|
-
:boolean => true,
|
38
|
-
:default => false
|
39
|
-
)
|
40
|
-
|
41
|
-
option(:disable_auto_provision,
|
42
|
-
:long => '--disable-auto-provision',
|
43
|
-
:boolean => true,
|
44
|
-
:default => false
|
45
|
-
)
|
46
|
-
|
47
|
-
option(:vagabond_file,
|
48
|
-
:short => '-f FILE',
|
49
|
-
:long => '--vagabond-file FILE'
|
50
|
-
)
|
51
|
-
|
52
|
-
option(:disable_local_server,
|
53
|
-
:long => '--disable-local-server',
|
54
|
-
:boolean => true,
|
55
|
-
:default => false
|
56
|
-
)
|
57
|
-
|
58
|
-
option(:debug,
|
59
|
-
:long => '--debug',
|
60
|
-
:boolean => true,
|
61
|
-
:default => false
|
62
|
-
)
|
63
|
-
|
64
|
-
option(:color,
|
65
|
-
:long => '--color',
|
66
|
-
:boolean => true
|
67
|
-
)
|
68
|
-
|
69
|
-
def run!(argv)
|
70
|
-
# Turn off Chef logging since we will deal with
|
71
|
-
# our own output
|
72
|
-
Chef::Log.init('/dev/null')
|
73
|
-
parse_options
|
74
|
-
name_args = parse_options(argv)
|
75
|
-
Config.merge!(config)
|
76
|
-
Config[:debug] = STDOUT if Config[:debug]
|
77
|
-
case name_args.first.to_s
|
78
|
-
when 'server'
|
79
|
-
Server.new(name_args.shift, name_args).send(:execute)
|
80
|
-
when 'knife'
|
81
|
-
Knife.new(name_args.shift, name_args).send(:execute)
|
82
|
-
else
|
83
|
-
Vagabond.new(name_args.shift, name_args).send(:execute)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|