knife-clodo 0.1.1 → 0.1.2
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/knife-clodo.gemspec
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'chef/knife/clodo_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class ClodoServerDelete < Knife
|
6
|
+
|
7
|
+
include Knife::ClodoBase
|
8
|
+
|
9
|
+
banner "knife clodo server delete (options)"
|
10
|
+
|
11
|
+
option :server,
|
12
|
+
:long => "--server ID",
|
13
|
+
:description => "The ID of the server",
|
14
|
+
:proc => Proc.new { |f| Chef::Config[:knife][:server_id] = f.to_i }
|
15
|
+
|
16
|
+
def run
|
17
|
+
$stdout.sync = true
|
18
|
+
|
19
|
+
connection.delete_server(Chef::Config[:knife][:server_id])
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'chef/knife/clodo_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class ClodoServerReboot < Knife
|
6
|
+
|
7
|
+
include Knife::ClodoBase
|
8
|
+
|
9
|
+
banner "knife clodo server reboot (options)"
|
10
|
+
|
11
|
+
option :server,
|
12
|
+
:long => "--server ID",
|
13
|
+
:description => "The ID of the server",
|
14
|
+
:proc => Proc.new { |f| Chef::Config[:knife][:server_id] = f.to_i }
|
15
|
+
|
16
|
+
def run
|
17
|
+
$stdout.sync = true
|
18
|
+
|
19
|
+
connection.reboot_server(Chef::Config[:knife][:server_id])
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'chef/knife/clodo_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class ClodoServerStart < Knife
|
6
|
+
|
7
|
+
include Knife::ClodoBase
|
8
|
+
|
9
|
+
banner "knife clodo server start (options)"
|
10
|
+
|
11
|
+
option :server,
|
12
|
+
:long => "--server ID",
|
13
|
+
:description => "The ID of the server",
|
14
|
+
:proc => Proc.new { |f| Chef::Config[:knife][:server_id] = f.to_i }
|
15
|
+
|
16
|
+
option :all,
|
17
|
+
:long => "--all",
|
18
|
+
:description => "Start all the servers that not in \"is_running\" state."
|
19
|
+
|
20
|
+
def run
|
21
|
+
$stdout.sync = true
|
22
|
+
|
23
|
+
if config[:all] then
|
24
|
+
|
25
|
+
servers = connection.servers.all.select {|s| case s.state when 'is_running' then false when 'is_request' then false else true end }
|
26
|
+
|
27
|
+
servers.each do |server|
|
28
|
+
connection.start_server(server.id)
|
29
|
+
end
|
30
|
+
|
31
|
+
elsif Chef::Config[:knife][:server_id] then
|
32
|
+
|
33
|
+
connection.start_server(Chef::Config[:knife][:server_id])
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'chef/knife/clodo_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class ClodoServerStop < Knife
|
6
|
+
|
7
|
+
include Knife::ClodoBase
|
8
|
+
|
9
|
+
banner "knife clodo server stop (options)"
|
10
|
+
|
11
|
+
option :server,
|
12
|
+
:long => "--server ID",
|
13
|
+
:description => "The ID of the server",
|
14
|
+
:proc => Proc.new { |f| Chef::Config[:knife][:server_id] = f.to_i }
|
15
|
+
|
16
|
+
def run
|
17
|
+
$stdout.sync = true
|
18
|
+
|
19
|
+
connection.stop_server(Chef::Config[:knife][:server_id])
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-clodo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stepan G. Fedorov
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-29 00:00:00 +04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -48,7 +48,11 @@ files:
|
|
48
48
|
- lib/chef/knife/bootstrap/debian6apt.erb
|
49
49
|
- lib/chef/knife/clodo_base.rb
|
50
50
|
- lib/chef/knife/clodo_server_create.rb
|
51
|
+
- lib/chef/knife/clodo_server_delete.rb
|
51
52
|
- lib/chef/knife/clodo_server_list.rb
|
53
|
+
- lib/chef/knife/clodo_server_reboot.rb
|
54
|
+
- lib/chef/knife/clodo_server_start.rb
|
55
|
+
- lib/chef/knife/clodo_server_stop.rb
|
52
56
|
has_rdoc: true
|
53
57
|
homepage: http://clodo.ru/
|
54
58
|
licenses: []
|