abiquo-etk 0.4.42 → 0.5.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/abicli +1 -0
- data/bin/abiquo-check-16-install +1 -127
- data/bin/abiquo-check-install +69 -0
- data/lib/abicli/commands/set.rb +12 -0
- data/lib/abicli/commands/set17.ext +7 -23
- data/lib/abicli/commands/upload-template.rb +56 -28
- data/lib/abiquo-etk.rb +47 -1
- data/lib/checks/1.7.5/01detect_abiquo.rb +4 -0
- data/lib/checks/{abiquo_service.rb → 1.7.5/abiquo_service.rb} +0 -0
- data/lib/checks/1.7.5/abiquo_version.rb +3 -0
- data/lib/checks/{components_installed.rb → 1.7.5/components_installed.rb} +0 -0
- data/lib/checks/{firewall.rb → 1.7.5/firewall.rb} +2 -2
- data/lib/checks/1.7.5/install_type.rb +4 -0
- data/lib/checks/{java.rb → 1.7.5/java.rb} +0 -0
- data/lib/checks/{mysql.rb → 1.7.5/mysql.rb} +0 -0
- data/lib/checks/{nfs.rb → 1.7.5/nfs.rb} +0 -0
- data/lib/checks/{os_version.rb → 1.7.5/os_version.rb} +0 -0
- data/lib/checks/{virtualbox.rb → 1.7.5/virtualbox.rb} +0 -0
- metadata +18 -20
- data/abiquo-etk.gemspec +0 -579
- data/bin/abiquo-initenv +0 -188
- data/lib/checks/01detect_abiquo.rb +0 -4
- data/lib/checks/abiquo_version.rb +0 -24
- data/lib/checks/hv_passwords.rb +0 -51
- data/lib/checks/install_type.rb +0 -8
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.5.3
|
data/bin/abicli
CHANGED
|
@@ -11,6 +11,7 @@ end
|
|
|
11
11
|
|
|
12
12
|
include AETK::OutputFormatters
|
|
13
13
|
|
|
14
|
+
|
|
14
15
|
TOMCAT_SERVER_CONFIG='/opt/abiquo/tomcat/conf/Catalina/localhost/server.xml'
|
|
15
16
|
TOMCAT_SERVER_BUILTIN_CONFIG='/opt/abiquo/tomcat/webapps/server/META-INF/context.xml'
|
|
16
17
|
TOMCAT_API_CONFIG='/opt/abiquo/tomcat/conf/Catalina/localhost/api.xml'
|
data/bin/abiquo-check-16-install
CHANGED
|
@@ -1,129 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
puts 'You need to run this as root.'
|
|
5
|
-
exit
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
begin
|
|
9
|
-
require 'lib/abiquo-etk'
|
|
10
|
-
rescue LoadError
|
|
11
|
-
require 'abiquo-etk'
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
class String
|
|
15
|
-
include Term::ANSIColor
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def print_server_config
|
|
20
|
-
puts "SERVER CONFIG".bold
|
|
21
|
-
puts "-------------"
|
|
22
|
-
sc = abiquo_server_config
|
|
23
|
-
puts " Version: #{config_property(sc, 'abicloud/version')}"
|
|
24
|
-
puts " Event Sink Address: #{config_property(sc, 'eventSinkAddress')}"
|
|
25
|
-
puts " API Location: #{config_property sc, 'apiLocation'}"
|
|
26
|
-
puts " Repository Space: #{config_property(sc,'repositorySpace')}"
|
|
27
|
-
puts " Session Timeout: #{config_property(sc, 'sessionTimeout')}"
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def print_virtualfactory_config
|
|
31
|
-
puts "VIRTUAL FACTORY".bold
|
|
32
|
-
puts "---------------"
|
|
33
|
-
sc = abiquo_virtualfactory_config
|
|
34
|
-
two_cols(" Hyper-V LocalRepo:", "#{config_property(sc, 'hypervisors/hyperv/localRepositoryPath')}")
|
|
35
|
-
two_cols(" Hyper-V DestRepo:", "#{config_property(sc, 'hypervisors/hyperv/destinationRepositoryPath')}")
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def print_vsm_config
|
|
39
|
-
puts "VIRTUAL SYSTEM MONITOR".bold
|
|
40
|
-
puts "----------------------"
|
|
41
|
-
sc = abiquo_vsm_config
|
|
42
|
-
two_cols(" VMWARE User:", "#{config_property(sc, 'hypervisors/vmware/user')}")
|
|
43
|
-
two_cols(" VMWARE Password:", "#{config_property(sc, 'hypervisors/vmware/password')}")
|
|
44
|
-
two_cols(" Hyper-V User:", "#{config_property(sc, 'hypervisors/hyperv/user')}")
|
|
45
|
-
two_cols(" Hyper-V Password:", "#{config_property(sc, 'hypervisors/hyperv/password')}")
|
|
46
|
-
two_cols(" LibVirt User:", "#{config_property(sc, 'hypervisors/libvirtAgent/user')}")
|
|
47
|
-
two_cols(" LibVirt Password:", "#{config_property(sc, 'hypervisors/libvirtAgent/password')}")
|
|
48
|
-
two_cols(" LibVirt Port:", "#{config_property(sc, 'hypervisors/libvirtAgent/port')}")
|
|
49
|
-
two_cols(" XenServer User:", "#{config_property(sc, 'hypervisors/xenserver/user')}")
|
|
50
|
-
two_cols(" XenServer Password:", "#{config_property(sc, 'hypervisors/xenserver/password')}")
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def print_nodecollector_config
|
|
54
|
-
puts "NODE COLLECTOR".bold
|
|
55
|
-
puts "--------------"
|
|
56
|
-
sc = abiquo_nodecollector_config
|
|
57
|
-
two_cols(" VMWARE User:", "#{config_property(sc, 'hypervisors/esxi/user')}")
|
|
58
|
-
two_cols(" VMWARE Password:", "#{config_property(sc, 'hypervisors/esxi/password')}")
|
|
59
|
-
two_cols(" Hyper-V User:", "#{config_property(sc, 'hypervisors/hyperv/user')}")
|
|
60
|
-
two_cols(" Hyper-V Password:", "#{config_property(sc, 'hypervisors/hyperv/password')}")
|
|
61
|
-
two_cols(" LibVirt User:", "#{config_property(sc, 'wsman/user')}")
|
|
62
|
-
two_cols(" LibVirt Password:", "#{config_property(sc, 'wsman/password')}")
|
|
63
|
-
two_cols(" LibVirt Port:", "#{config_property(sc, 'wsman/port')}")
|
|
64
|
-
two_cols(" XenServer User:", "#{config_property(sc, 'hypervisors/xenserver/user')}")
|
|
65
|
-
two_cols(" XenServer Password:", "#{config_property(sc, 'hypervisors/xenserver/password')}")
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
class MyCLI
|
|
69
|
-
include Mixlib::CLI
|
|
70
|
-
|
|
71
|
-
option :debug,
|
|
72
|
-
:long => "--debug",
|
|
73
|
-
:description => "Set the log level to debug",
|
|
74
|
-
#:required => true,
|
|
75
|
-
:proc => Proc.new { |l| AETK::Log.instance.level = Logger::DEBUG }
|
|
76
|
-
|
|
77
|
-
option :print_configs,
|
|
78
|
-
:long => "--print-configs",
|
|
79
|
-
:description => "Print Abiquo Configs"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
option :extra_plugins,
|
|
83
|
-
:long => '--extra-plugins DIR',
|
|
84
|
-
:description => 'Extra plugins directory',
|
|
85
|
-
:default => nil
|
|
86
|
-
|
|
87
|
-
option :version,
|
|
88
|
-
:long => '--version',
|
|
89
|
-
:short => '-v',
|
|
90
|
-
:proc => Proc.new { puts "Abiquo Elite Toolkit Version " + File.read(File.dirname(__FILE__) + '/../VERSION') },
|
|
91
|
-
:exit => 0
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
option :help,
|
|
95
|
-
:short => "-h",
|
|
96
|
-
:long => "--help",
|
|
97
|
-
:description => "Show this message",
|
|
98
|
-
:on => :tail,
|
|
99
|
-
:boolean => true,
|
|
100
|
-
:show_options => true,
|
|
101
|
-
:exit => 0
|
|
102
|
-
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
# ARGV = [ '-c', 'foo.rb', '-l', 'debug' ]
|
|
106
|
-
cli = MyCLI.new
|
|
107
|
-
cli.parse_options
|
|
108
|
-
|
|
109
|
-
AETK.load_plugins(cli.config[:extra_plugins])
|
|
110
|
-
include AETK::OutputFormatters
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if cli.config[:print_configs]
|
|
114
|
-
# print config info
|
|
115
|
-
#
|
|
116
|
-
puts "\n"
|
|
117
|
-
if abiquo_components_installed.include? 'server'
|
|
118
|
-
print_server_config
|
|
119
|
-
end
|
|
120
|
-
puts "\n"
|
|
121
|
-
if abiquo_components_installed.include? 'virtualfactory'
|
|
122
|
-
print_virtualfactory_config
|
|
123
|
-
end
|
|
124
|
-
puts "\n"
|
|
125
|
-
if abiquo_components_installed.include? 'nodecollector'
|
|
126
|
-
print_nodecollector_config
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
|
|
3
|
+
load "#{File.dirname(__FILE__)}/abiquo-check-install"
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'rubygems'
|
|
4
|
+
require 'abiquo-etk'
|
|
5
|
+
|
|
6
|
+
begin
|
|
7
|
+
v = AETK::System.abiquo_version
|
|
8
|
+
if v !~ /1\.7\.5/
|
|
9
|
+
raise Exception.new
|
|
10
|
+
end
|
|
11
|
+
rescue Exception => e
|
|
12
|
+
$stderr.puts 'This version of abicli only supports Abiquo 1.7.5. Use abiquo-etk <= 0.4.42'
|
|
13
|
+
$stderr.puts "DEBUG: #{e.message}"
|
|
14
|
+
exit 1
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
if `whoami`.strip.chomp != 'root'
|
|
18
|
+
puts 'You need to run this as root.'
|
|
19
|
+
exit
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
begin
|
|
23
|
+
require 'lib/abiquo-etk'
|
|
24
|
+
rescue LoadError
|
|
25
|
+
require 'rubygems'
|
|
26
|
+
require 'abiquo-etk'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class String
|
|
30
|
+
include Term::ANSIColor
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class MyCLI
|
|
34
|
+
include Mixlib::CLI
|
|
35
|
+
|
|
36
|
+
option :debug,
|
|
37
|
+
:long => "--debug",
|
|
38
|
+
:description => "Set the log level to debug",
|
|
39
|
+
#:required => true,
|
|
40
|
+
:proc => Proc.new { |l| AETK::Log.instance.level = Logger::DEBUG }
|
|
41
|
+
|
|
42
|
+
option :extra_plugins,
|
|
43
|
+
:long => '--extra-plugins DIR',
|
|
44
|
+
:description => 'Extra plugins directory',
|
|
45
|
+
:default => nil
|
|
46
|
+
|
|
47
|
+
option :version,
|
|
48
|
+
:long => '--version',
|
|
49
|
+
:short => '-v',
|
|
50
|
+
:proc => Proc.new { puts "Abiquo Elite Toolkit Version " + File.read(File.dirname(__FILE__) + '/../VERSION') },
|
|
51
|
+
:exit => 0
|
|
52
|
+
|
|
53
|
+
option :help,
|
|
54
|
+
:short => "-h",
|
|
55
|
+
:long => "--help",
|
|
56
|
+
:description => "Show this message",
|
|
57
|
+
:on => :tail,
|
|
58
|
+
:boolean => true,
|
|
59
|
+
:show_options => true,
|
|
60
|
+
:exit => 0
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# ARGV = [ '-c', 'foo.rb', '-l', 'debug' ]
|
|
65
|
+
cli = MyCLI.new
|
|
66
|
+
cli.parse_options
|
|
67
|
+
|
|
68
|
+
AETK.load_plugins(cli.config[:extra_plugins])
|
|
69
|
+
include AETK::OutputFormatters
|
data/lib/abicli/commands/set.rb
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
|
|
1
2
|
if ARGV[0] == 'set'
|
|
2
3
|
if not File.exist?('/etc/abiquo-release')
|
|
3
4
|
$stderr.puts "Abiquo release version not found. Unsupported installation."
|
|
4
5
|
exit
|
|
5
6
|
end
|
|
7
|
+
|
|
8
|
+
begin
|
|
9
|
+
v = AETK::System.abiquo_version
|
|
10
|
+
if v !~ /1\.7\.5/
|
|
11
|
+
raise Exception.new
|
|
12
|
+
end
|
|
13
|
+
rescue Exception
|
|
14
|
+
$stderr.puts 'This version of abicli only supports Abiquo 1.7.5. Use abiquo-etk <= 0.4.42'
|
|
15
|
+
exit 1
|
|
16
|
+
end
|
|
17
|
+
|
|
6
18
|
rel_info = File.read('/etc/abiquo-release')
|
|
7
19
|
if rel_info =~ /Version: 1\.7/
|
|
8
20
|
load File.dirname(__FILE__) + "/set17.ext"
|
|
@@ -75,31 +75,16 @@ def set_nfs_repository(val)
|
|
|
75
75
|
config.save('/opt/abiquo/config/abiquo.properties')
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
def set_ontap_server_ip(val)
|
|
79
|
-
f = ABIQUO_BASE_DIR + '/ontap/tomcat/webapps/ROOT/WEB-INF/classes/config.xml'
|
|
80
|
-
if File.exist? f
|
|
81
|
-
config_set_node(f, 'filer/host', val, true)
|
|
82
|
-
else
|
|
83
|
-
$stderr.puts "NetApp Ontap Connector not installed. Ignoring the order."
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
|
|
87
78
|
def set_ontap_user(val)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
else
|
|
92
|
-
$stderr.puts "NetApp Ontap Connector not installed. Ignoring the order."
|
|
93
|
-
end
|
|
79
|
+
config = IniParse.parse(File.read('/opt/abiquo/config/abiquo.properties'))
|
|
80
|
+
config['remote-services']['abiquo.storagemanager.netapp.user'] = val
|
|
81
|
+
config.save('/opt/abiquo/config/abiquo.properties')
|
|
94
82
|
end
|
|
95
83
|
|
|
96
84
|
def set_ontap_password(val)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
else
|
|
101
|
-
$stderr.puts "NetApp Ontap Connector not installed. Ignoring the order."
|
|
102
|
-
end
|
|
85
|
+
config = IniParse.parse(File.read('/opt/abiquo/config/abiquo.properties'))
|
|
86
|
+
config['remote-services']['abiquo.storagemanager.netapp.password'] = val
|
|
87
|
+
config.save('/opt/abiquo/config/abiquo.properties')
|
|
103
88
|
end
|
|
104
89
|
|
|
105
90
|
def set_property(section, key, val)
|
|
@@ -160,8 +145,7 @@ $command_mappings = {
|
|
|
160
145
|
'database-user' => Proc.new { |val| set_database_user(val) },
|
|
161
146
|
'database-password' => Proc.new { |val| set_database_password(val) },
|
|
162
147
|
'ontap-user' => Proc.new { |val| set_ontap_user(val) },
|
|
163
|
-
'ontap-password' => Proc.new { |val| set_ontap_password(val) }
|
|
164
|
-
'ontap-server-ip' => Proc.new { |val| set_ontap_server_ip(val) }
|
|
148
|
+
'ontap-password' => Proc.new { |val| set_ontap_password(val) }
|
|
165
149
|
}
|
|
166
150
|
|
|
167
151
|
def mapping_exist?(key)
|
|
@@ -39,7 +39,7 @@ if ARGV[0] == 'upload-template'
|
|
|
39
39
|
parts << StringPart.new("\r\n")
|
|
40
40
|
else
|
|
41
41
|
parts << StringPart.new( "--" + boundary + "\r\n" +
|
|
42
|
-
"Content-Disposition: form-data; name=\"" + key.to_s + "\"\r\n\r\n")
|
|
42
|
+
"Content-Disposition: form-data; Content-Type:application/json; name=\"" + key.to_s + "\"\r\n\r\n")
|
|
43
43
|
parts << StringPart.new(value.to_s + "\r\n")
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -149,37 +149,36 @@ if ARGV[0] == 'upload-template'
|
|
|
149
149
|
class MyCLI
|
|
150
150
|
include Mixlib::CLI
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
:long => '--enterprise-id USER',
|
|
154
|
-
:description => 'Enterprise ID',
|
|
155
|
-
:default => 1
|
|
156
|
-
|
|
152
|
+
# Mandatory values
|
|
157
153
|
option :name,
|
|
158
154
|
:long => '--name NAME',
|
|
159
155
|
:description => 'Template Name'
|
|
160
156
|
|
|
157
|
+
option :enterprise_id,
|
|
158
|
+
:long => '--enterprise-id USER',
|
|
159
|
+
:description => 'Enterprise ID'
|
|
160
|
+
|
|
161
161
|
option :disk_file,
|
|
162
162
|
:long => '--disk-file FILE',
|
|
163
163
|
:description => 'Virtual disk file to upload'
|
|
164
|
-
|
|
165
|
-
option :category,
|
|
166
|
-
:long => '--category CAT',
|
|
167
|
-
:description => 'Template Category Name',
|
|
168
|
-
:default => 'Operating Systems'
|
|
169
164
|
|
|
170
|
-
option :
|
|
171
|
-
:long => '--
|
|
172
|
-
:description => '
|
|
173
|
-
:default => 'Operating Systems'
|
|
165
|
+
option :disk_name,
|
|
166
|
+
:long => '--disk-name NAME',
|
|
167
|
+
:description => 'The name that will have the disk in the target repository (use the extension is encouraged)'
|
|
174
168
|
|
|
175
|
-
option :
|
|
176
|
-
:long => '--
|
|
177
|
-
:description => '
|
|
178
|
-
:default => 'http://icons.abiquo.com/abiquo.png'
|
|
169
|
+
option :rs_url,
|
|
170
|
+
:long => '--rs-url URL',
|
|
171
|
+
:description => 'Remote Services URL (i.e. http://remote-services-ip)'
|
|
179
172
|
|
|
173
|
+
# Mandatory values with default values
|
|
174
|
+
option :disk_format,
|
|
175
|
+
:long => '--disk-format FORMAT',
|
|
176
|
+
:description => 'Disk Format type. Default: QCOW2_SPARSE',
|
|
177
|
+
:default => 'QCOW2_SPARSE'
|
|
178
|
+
|
|
180
179
|
option :cpus,
|
|
181
180
|
:long => '--cpus NUMBER',
|
|
182
|
-
:description => 'Number of CPUs for the template',
|
|
181
|
+
:description => 'Number of CPUs for the template. Default 1',
|
|
183
182
|
:default => 1
|
|
184
183
|
|
|
185
184
|
option :disk_capacity,
|
|
@@ -192,16 +191,28 @@ if ARGV[0] == 'upload-template'
|
|
|
192
191
|
:description => 'Template memory (in bytes). Default 512M',
|
|
193
192
|
:default => 524288
|
|
194
193
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
:
|
|
194
|
+
# Optional values
|
|
195
|
+
option :category,
|
|
196
|
+
:long => '--category CAT',
|
|
197
|
+
:description => 'Template Category Name',
|
|
198
|
+
:default => 'Operating Systems'
|
|
199
|
+
|
|
200
|
+
option :description,
|
|
201
|
+
:long => '--description DESC',
|
|
202
|
+
:description => 'Template description',
|
|
203
|
+
:default => 'Operating Systems'
|
|
198
204
|
|
|
205
|
+
option :icon_url,
|
|
206
|
+
:long => '--icon-url URL',
|
|
207
|
+
:description => 'Template Icon URL',
|
|
208
|
+
:default => 'http://icons.abiquo.com/abiquo.png'
|
|
209
|
+
|
|
210
|
+
# Help actions
|
|
199
211
|
option :debug,
|
|
200
212
|
:long => '--debug',
|
|
201
213
|
:description => 'Print debugging output',
|
|
202
214
|
:default => false
|
|
203
215
|
|
|
204
|
-
|
|
205
216
|
option :help,
|
|
206
217
|
:short => "-h",
|
|
207
218
|
:long => "--help",
|
|
@@ -227,21 +238,38 @@ if ARGV[0] == 'upload-template'
|
|
|
227
238
|
rs_url = cli.config[:rs_url]
|
|
228
239
|
if rs_url.nil?
|
|
229
240
|
$stderr.puts "\n --rs-url is required.\n\n"
|
|
241
|
+
puts cli.opt_parser.help
|
|
230
242
|
exit 1
|
|
231
243
|
end
|
|
232
244
|
tname = cli.config[:name]
|
|
233
245
|
if tname.nil?
|
|
234
246
|
$stderr.puts "\n --name is required.\n\n"
|
|
247
|
+
puts cli.opt_parser.help
|
|
248
|
+
exit 1
|
|
249
|
+
end
|
|
250
|
+
ent = cli.config[:enterprise_id]
|
|
251
|
+
if ent.nil?
|
|
252
|
+
$stderr.puts "\n --enterprise-id is required.\n\n"
|
|
253
|
+
puts cli.opt_parser.help
|
|
235
254
|
exit 1
|
|
236
255
|
end
|
|
256
|
+
disk_name = cli.config[:disk_name]
|
|
257
|
+
if disk_name.nil?
|
|
258
|
+
splitted_disk = file.split("/")
|
|
259
|
+
disk_name = splitted_disk[splitted_disk.size-1]
|
|
260
|
+
puts disk_name
|
|
261
|
+
end
|
|
237
262
|
|
|
238
263
|
fo = File.new(file)
|
|
239
264
|
fsize = File.size(file)
|
|
240
265
|
count = 0
|
|
241
|
-
json = """{
|
|
266
|
+
json = """{'ovfPackageInstanceDto':{
|
|
242
267
|
'idEnterprise':#{cli.config[:enterprise_id]},
|
|
243
268
|
'ovfUrl':'http://upload/#{cli.config[:name]}/#{cli.config[:name]}.ovf',
|
|
244
|
-
'diskFileFormat':'
|
|
269
|
+
'diskFileFormat':'#{cli.config[:disk_format]}',
|
|
270
|
+
'ramSizeUnit':'BYTE',
|
|
271
|
+
'hdSizeUnit':'BYTE',
|
|
272
|
+
'diskFilePath':'#{disk_name}',
|
|
245
273
|
'name':'#{cli.config[:name]}',
|
|
246
274
|
'description':'#{cli.config[:description]}',
|
|
247
275
|
'categoryName':'#{cli.config[:category]}',
|
|
@@ -249,11 +277,11 @@ json = """{
|
|
|
249
277
|
'cpu':#{cli.config[:cpus]},
|
|
250
278
|
'hd':#{cli.config[:disk_capacity]},
|
|
251
279
|
'ram':#{cli.config[:memory]}
|
|
252
|
-
}"""
|
|
280
|
+
}}"""
|
|
253
281
|
json.gsub!("'",'"')
|
|
254
282
|
$stdout.sync = true
|
|
255
283
|
line_reset = "\r\e[0K"
|
|
256
|
-
rsurl = "#{cli.config[:rs_url]}/am/
|
|
284
|
+
rsurl = "#{cli.config[:rs_url]}/am/erepos/#{cli.config[:enterprise_id]}/ovfs"
|
|
257
285
|
if cli.config[:debug]
|
|
258
286
|
puts "Upload URL: #{rsurl}"
|
|
259
287
|
puts "JSON sent:\n#{json}"
|
data/lib/abiquo-etk.rb
CHANGED
|
@@ -168,6 +168,11 @@ module AETK
|
|
|
168
168
|
end
|
|
169
169
|
|
|
170
170
|
class System
|
|
171
|
+
|
|
172
|
+
def self.abiquo_version
|
|
173
|
+
File.read('/etc/abiquo-release').match(/Version:(.*)/)[1].to_s.strip.chomp
|
|
174
|
+
end
|
|
175
|
+
|
|
171
176
|
def self.detect_install_type
|
|
172
177
|
found = ['bpm-async', 'am', 'server'].each do |dir|
|
|
173
178
|
break if not File.directory?(ABIQUO_BASE_DIR + "/tomcat/webapps/#{dir}")
|
|
@@ -197,12 +202,53 @@ module AETK
|
|
|
197
202
|
return :unknown
|
|
198
203
|
|
|
199
204
|
end
|
|
205
|
+
|
|
206
|
+
def self.detect_install_type2
|
|
207
|
+
itype = []
|
|
208
|
+
found = ['bpm-async', 'am', 'server'].each do |dir|
|
|
209
|
+
break if not File.directory?(ABIQUO_BASE_DIR + "/tomcat/webapps/#{dir}")
|
|
210
|
+
end
|
|
211
|
+
itype << :monolithic if found
|
|
212
|
+
|
|
213
|
+
found = ['am', 'virtualfactory', 'bpm-async'].each do |dir|
|
|
214
|
+
break if not File.directory?(ABIQUO_BASE_DIR + "/tomcat/webapps/#{dir}")
|
|
215
|
+
end
|
|
216
|
+
itype << :rs_plus_v2v if found
|
|
217
|
+
|
|
218
|
+
found = ['am', 'virtualfactory'].each do |dir|
|
|
219
|
+
break if not File.directory?(ABIQUO_BASE_DIR + "/tomcat/webapps/#{dir}")
|
|
220
|
+
end
|
|
221
|
+
itype << :remote_services if found
|
|
222
|
+
|
|
223
|
+
found = ['server', 'api'].each do |dir|
|
|
224
|
+
break if not File.directory?(ABIQUO_BASE_DIR + "/tomcat/webapps/#{dir}")
|
|
225
|
+
end
|
|
226
|
+
itype << :server if found
|
|
227
|
+
|
|
228
|
+
found = ['bpm-async'].each do |dir|
|
|
229
|
+
break if not File.directory?(ABIQUO_BASE_DIR + "/tomcat/webapps/#{dir}")
|
|
230
|
+
end
|
|
231
|
+
itype << :v2v if found
|
|
232
|
+
|
|
233
|
+
itype << :cloudnode_vbox if RPMUtils.rpm_installed?('abiquo-virtualbox')
|
|
234
|
+
itype << :cloudnode_kvm if RPMUtils.rpm_installed?('abiquo-cloud-node') and \
|
|
235
|
+
RPMUtils.rpm_installed?('kvm') and not RPMUtils.rpm_installed?('xen')
|
|
236
|
+
itype << :cloudnode_xen if RPMUtils.rpm_installed?('abiquo-cloud-node') and \
|
|
237
|
+
RPMUtils.rpm_installed?('xen')
|
|
238
|
+
|
|
239
|
+
if itype.size > 0
|
|
240
|
+
itype
|
|
241
|
+
else
|
|
242
|
+
return [:unknown]
|
|
243
|
+
end
|
|
244
|
+
end
|
|
200
245
|
end
|
|
201
246
|
|
|
202
247
|
|
|
203
248
|
def self.load_plugins(extra_plugins_dir = nil)
|
|
204
249
|
puts "Loading plugins...".yellow.bold
|
|
205
|
-
|
|
250
|
+
version = System.abiquo_version.gsub(/-(rc\d|ga|final|beta|preview|alpha)/i,'')
|
|
251
|
+
plugins = Dir[File.dirname(__FILE__) + "/checks/#{version}/*.rb"].sort
|
|
206
252
|
if extra_plugins_dir and File.directory? extra_plugins_dir
|
|
207
253
|
puts "Loading extra plugins...".yellow.bold
|
|
208
254
|
plugins.concat( Dir[extra_plugins_dir + '/*.rb'].sort )
|
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ def fw_rules_defined?
|
|
|
4
4
|
not `iptables -nL | grep -iv ^chain | grep -iv ^target | grep -v ^$`.empty?
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
-
puts "Firewall Service:".bold.ljust(40) + (system_service_on?('iptables') ? 'Active'.
|
|
7
|
+
puts "Firewall Service:".bold.ljust(40) + (system_service_on?('iptables') ? 'Active'.yellow.bold : 'Disabled'.green.bold)
|
|
8
8
|
|
|
9
|
-
puts "Firewall Rules:".bold.ljust(40) + (fw_rules_defined? ? 'Found'.
|
|
9
|
+
puts "Firewall Rules:".bold.ljust(40) + (fw_rules_defined? ? 'Found'.yellow.bold : "Not Found".green.bold)
|
|
10
10
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: abiquo-etk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 13
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
version: 0.
|
|
8
|
+
- 5
|
|
9
|
+
- 3
|
|
10
|
+
version: 0.5.3
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Sergio Rubio
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-
|
|
18
|
+
date: 2011-04-20 00:00:00 +02:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
@@ -97,8 +97,8 @@ dependencies:
|
|
|
97
97
|
description: Tools to troubleshoot and manage your Abiquo installation
|
|
98
98
|
email: srubio@abiquo.com
|
|
99
99
|
executables:
|
|
100
|
+
- abiquo-check-install
|
|
100
101
|
- abicli
|
|
101
|
-
- abiquo-initenv
|
|
102
102
|
- abiquo-check-16-install
|
|
103
103
|
extensions: []
|
|
104
104
|
|
|
@@ -113,11 +113,10 @@ files:
|
|
|
113
113
|
- Rakefile
|
|
114
114
|
- TODO
|
|
115
115
|
- VERSION
|
|
116
|
-
- abiquo-etk.gemspec
|
|
117
116
|
- abiquo-etk.spec
|
|
118
117
|
- bin/abicli
|
|
119
118
|
- bin/abiquo-check-16-install
|
|
120
|
-
- bin/abiquo-
|
|
119
|
+
- bin/abiquo-check-install
|
|
121
120
|
- lib/abicli/commands/instant-deploy.rb
|
|
122
121
|
- lib/abicli/commands/remote-services-settings.rb
|
|
123
122
|
- lib/abicli/commands/remote-services-settings16.ext
|
|
@@ -132,18 +131,17 @@ files:
|
|
|
132
131
|
- lib/abicli/commands/upload-template.rb
|
|
133
132
|
- lib/abicli/commands/version.rb
|
|
134
133
|
- lib/abiquo-etk.rb
|
|
135
|
-
- lib/checks/01detect_abiquo.rb
|
|
136
|
-
- lib/checks/abiquo_service.rb
|
|
137
|
-
- lib/checks/abiquo_version.rb
|
|
138
|
-
- lib/checks/components_installed.rb
|
|
139
|
-
- lib/checks/firewall.rb
|
|
140
|
-
- lib/checks/
|
|
141
|
-
- lib/checks/
|
|
142
|
-
- lib/checks/
|
|
143
|
-
- lib/checks/
|
|
144
|
-
- lib/checks/
|
|
145
|
-
- lib/checks/
|
|
146
|
-
- lib/checks/virtualbox.rb
|
|
134
|
+
- lib/checks/1.7.5/01detect_abiquo.rb
|
|
135
|
+
- lib/checks/1.7.5/abiquo_service.rb
|
|
136
|
+
- lib/checks/1.7.5/abiquo_version.rb
|
|
137
|
+
- lib/checks/1.7.5/components_installed.rb
|
|
138
|
+
- lib/checks/1.7.5/firewall.rb
|
|
139
|
+
- lib/checks/1.7.5/install_type.rb
|
|
140
|
+
- lib/checks/1.7.5/java.rb
|
|
141
|
+
- lib/checks/1.7.5/mysql.rb
|
|
142
|
+
- lib/checks/1.7.5/nfs.rb
|
|
143
|
+
- lib/checks/1.7.5/os_version.rb
|
|
144
|
+
- lib/checks/1.7.5/virtualbox.rb
|
|
147
145
|
- lib/upgrades/17-nuclear-launch
|
|
148
146
|
- scripts/setup_rs
|
|
149
147
|
- scripts/setup_v2v
|