nephele 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/bin/neph +31 -19
- data/bin/nephele +31 -19
- data/lib/nephele/rackspace.rb +5 -1
- data/nephele.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/bin/neph
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'optitron'
|
5
|
-
|
6
|
-
|
7
|
-
rescue LoadError
|
5
|
+
|
6
|
+
if __FILE__ =~ /bin\/neph/
|
8
7
|
$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
|
9
8
|
require 'nephele'
|
9
|
+
else
|
10
|
+
require 'nephele'
|
10
11
|
end
|
11
12
|
# awesome_print doesn't seem to play nice with optitron?
|
12
13
|
#require 'ap'
|
@@ -39,16 +40,6 @@ class Nephele::Runner < Optitron::CLI
|
|
39
40
|
puts service.status
|
40
41
|
end
|
41
42
|
|
42
|
-
desc 'Change a password on given node'
|
43
|
-
def password(node_string, password_string)
|
44
|
-
service.server_objs.find { |s| s.name == node_string }.update(:adminPass => password_string)
|
45
|
-
end
|
46
|
-
|
47
|
-
desc 'Save an image of the node'
|
48
|
-
def save(node_string, savename_string)
|
49
|
-
service.server_objs.find { |s| s.name == node_string }.create_image name_string
|
50
|
-
end
|
51
|
-
|
52
43
|
desc "Creates a node with name, image name, flavor"
|
53
44
|
opt 'count', 'create foo, foo2, foo3, ...', :type => :numeric
|
54
45
|
def create(name, image, flavor)
|
@@ -66,6 +57,29 @@ class Nephele::Runner < Optitron::CLI
|
|
66
57
|
end
|
67
58
|
end
|
68
59
|
|
60
|
+
desc 'Save an image of the node'
|
61
|
+
def save(nodename, savename)
|
62
|
+
service.server_objs.find { |s| s.name == nodename }.create_image savename
|
63
|
+
end
|
64
|
+
|
65
|
+
desc 'Destroy a given node'
|
66
|
+
def destroy(name_string)
|
67
|
+
if node = service.server_objs.find { |s| s.name == name_string }
|
68
|
+
puts "Destroying: #{name_string}"
|
69
|
+
node.delete!
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
desc 'Change a password on given node'
|
74
|
+
def password(node_string, password_string)
|
75
|
+
service.server_objs.find { |s| s.name == node_string }.update(:adminPass => password_string)
|
76
|
+
end
|
77
|
+
|
78
|
+
desc 'Delete an image'
|
79
|
+
def delete(image)
|
80
|
+
service.delete_image image
|
81
|
+
end
|
82
|
+
|
69
83
|
desc 'Create a VM and run a chef bootstrapper, optional recipe, bootstrap, cookbooks args'
|
70
84
|
def bootstrap(name, image, flavor)
|
71
85
|
puts "Bootstrapping: #{name}..."
|
@@ -81,12 +95,10 @@ class Nephele::Runner < Optitron::CLI
|
|
81
95
|
bootstrap name, image, flavor
|
82
96
|
end
|
83
97
|
|
84
|
-
desc '
|
85
|
-
def
|
86
|
-
|
87
|
-
|
88
|
-
node.delete!
|
89
|
-
end
|
98
|
+
desc 'Boostrap a VM and save an image of it'
|
99
|
+
def archive(name, image, flavor, savename)
|
100
|
+
bootstrap name, image, flavor
|
101
|
+
save name, savename
|
90
102
|
end
|
91
103
|
|
92
104
|
def service
|
data/bin/nephele
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'optitron'
|
5
|
-
|
6
|
-
|
7
|
-
rescue LoadError
|
5
|
+
|
6
|
+
if __FILE__ =~ /bin\/neph/
|
8
7
|
$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
|
9
8
|
require 'nephele'
|
9
|
+
else
|
10
|
+
require 'nephele'
|
10
11
|
end
|
11
12
|
# awesome_print doesn't seem to play nice with optitron?
|
12
13
|
#require 'ap'
|
@@ -39,16 +40,6 @@ class Nephele::Runner < Optitron::CLI
|
|
39
40
|
puts service.status
|
40
41
|
end
|
41
42
|
|
42
|
-
desc 'Change a password on given node'
|
43
|
-
def password(node_string, password_string)
|
44
|
-
service.server_objs.find { |s| s.name == node_string }.update(:adminPass => password_string)
|
45
|
-
end
|
46
|
-
|
47
|
-
desc 'Save an image of the node'
|
48
|
-
def save(node_string, savename_string)
|
49
|
-
service.server_objs.find { |s| s.name == node_string }.create_image name_string
|
50
|
-
end
|
51
|
-
|
52
43
|
desc "Creates a node with name, image name, flavor"
|
53
44
|
opt 'count', 'create foo, foo2, foo3, ...', :type => :numeric
|
54
45
|
def create(name, image, flavor)
|
@@ -66,6 +57,29 @@ class Nephele::Runner < Optitron::CLI
|
|
66
57
|
end
|
67
58
|
end
|
68
59
|
|
60
|
+
desc 'Save an image of the node'
|
61
|
+
def save(nodename, savename)
|
62
|
+
service.server_objs.find { |s| s.name == nodename }.create_image savename
|
63
|
+
end
|
64
|
+
|
65
|
+
desc 'Destroy a given node'
|
66
|
+
def destroy(name_string)
|
67
|
+
if node = service.server_objs.find { |s| s.name == name_string }
|
68
|
+
puts "Destroying: #{name_string}"
|
69
|
+
node.delete!
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
desc 'Change a password on given node'
|
74
|
+
def password(node_string, password_string)
|
75
|
+
service.server_objs.find { |s| s.name == node_string }.update(:adminPass => password_string)
|
76
|
+
end
|
77
|
+
|
78
|
+
desc 'Delete an image'
|
79
|
+
def delete(image)
|
80
|
+
service.delete_image image
|
81
|
+
end
|
82
|
+
|
69
83
|
desc 'Create a VM and run a chef bootstrapper, optional recipe, bootstrap, cookbooks args'
|
70
84
|
def bootstrap(name, image, flavor)
|
71
85
|
puts "Bootstrapping: #{name}..."
|
@@ -81,12 +95,10 @@ class Nephele::Runner < Optitron::CLI
|
|
81
95
|
bootstrap name, image, flavor
|
82
96
|
end
|
83
97
|
|
84
|
-
desc '
|
85
|
-
def
|
86
|
-
|
87
|
-
|
88
|
-
node.delete!
|
89
|
-
end
|
98
|
+
desc 'Boostrap a VM and save an image of it'
|
99
|
+
def archive(name, image, flavor, savename)
|
100
|
+
bootstrap name, image, flavor
|
101
|
+
save name, savename
|
90
102
|
end
|
91
103
|
|
92
104
|
def service
|
data/lib/nephele/rackspace.rb
CHANGED
@@ -42,6 +42,10 @@ class Nephele::Rackspace < Nephele::Base
|
|
42
42
|
@nodes.delete_if { |n| n.id == id }
|
43
43
|
end
|
44
44
|
|
45
|
+
def delete_image(image)
|
46
|
+
del = image_objs.find { |i| i.name == image } && del.delete!
|
47
|
+
end
|
48
|
+
|
45
49
|
def status
|
46
50
|
header = "#{'NAME'.ljust(20)} #{'STATUS'.ljust(6)} #{'-%-'.ljust(3)} #{'Kind'.ljust(10)} Public IP\n"
|
47
51
|
info = server_objs.inject('') do |acc, s|
|
@@ -78,7 +82,7 @@ class Nephele::Rackspace < Nephele::Base
|
|
78
82
|
|
79
83
|
def self.image_lookup(name)
|
80
84
|
case name
|
81
|
-
when
|
85
|
+
when /^lucid$/
|
82
86
|
"Ubuntu 10.04 LTS (lucid)"
|
83
87
|
else
|
84
88
|
name
|
data/nephele.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nephele
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeffrey O'Dell
|