ohai 6.24.2 → 7.0.0.rc.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ohai.rb +1 -1
- data/lib/ohai/application.rb +5 -12
- data/lib/ohai/common/dmi.rb +126 -0
- data/lib/ohai/config.rb +9 -9
- data/lib/ohai/{plugins/darwin/hostname.rb → dsl.rb} +7 -7
- data/lib/ohai/dsl/plugin.rb +186 -0
- data/lib/ohai/dsl/plugin/versionvi.rb +62 -0
- data/lib/ohai/dsl/plugin/versionvii.rb +106 -0
- data/lib/ohai/exception.rb +11 -2
- data/lib/ohai/hints.rb +48 -0
- data/lib/ohai/loader.rb +205 -0
- data/lib/ohai/mixin/command.rb +14 -18
- data/lib/ohai/mixin/constant_helper.rb +53 -0
- data/lib/ohai/mixin/gce_metadata.rb +0 -2
- data/lib/ohai/{plugins/freebsd/uptime.rb → mixin/network_constants.rb} +15 -13
- data/lib/ohai/mixin/os.rb +59 -0
- data/lib/ohai/mixin/seconds_to_human.rb +48 -0
- data/lib/ohai/plugins/aix/cpu.rb +26 -22
- data/lib/ohai/plugins/aix/filesystem.rb +47 -48
- data/lib/ohai/plugins/aix/kernel.rb +11 -7
- data/lib/ohai/plugins/aix/memory.rb +8 -4
- data/lib/ohai/plugins/aix/network.rb +73 -82
- data/lib/ohai/plugins/aix/platform.rb +9 -6
- data/lib/ohai/plugins/aix/uptime.rb +14 -12
- data/lib/ohai/plugins/azure.rb +33 -11
- data/lib/ohai/plugins/c.rb +103 -78
- data/lib/ohai/plugins/chef.rb +20 -8
- data/lib/ohai/plugins/cloud.rb +234 -230
- data/lib/ohai/plugins/command.rb +6 -2
- data/lib/ohai/plugins/darwin/cpu.rb +10 -4
- data/lib/ohai/plugins/darwin/filesystem.rb +32 -32
- data/lib/ohai/plugins/darwin/network.rb +157 -154
- data/lib/ohai/plugins/darwin/platform.rb +18 -16
- data/lib/ohai/plugins/darwin/system_profiler.rb +49 -46
- data/lib/ohai/plugins/dmi.rb +102 -102
- data/lib/ohai/plugins/ec2.rb +30 -28
- data/lib/ohai/plugins/erlang.rb +19 -16
- data/lib/ohai/plugins/eucalyptus.rb +37 -36
- data/lib/ohai/plugins/freebsd/cpu.rb +34 -29
- data/lib/ohai/plugins/freebsd/filesystem.rb +32 -32
- data/lib/ohai/plugins/freebsd/memory.rb +35 -25
- data/lib/ohai/plugins/freebsd/network.rb +94 -89
- data/lib/ohai/plugins/freebsd/platform.rb +10 -4
- data/lib/ohai/plugins/freebsd/virtualization.rb +62 -61
- data/lib/ohai/plugins/gce.rb +30 -36
- data/lib/ohai/plugins/groovy.rb +14 -11
- data/lib/ohai/plugins/hostname.rb +132 -10
- data/lib/ohai/plugins/ip_scopes.rb +31 -16
- data/lib/ohai/plugins/java.rb +45 -21
- data/lib/ohai/plugins/kernel.rb +186 -19
- data/lib/ohai/plugins/keys.rb +6 -2
- data/lib/ohai/plugins/languages.rb +6 -2
- data/lib/ohai/plugins/linode.rb +38 -30
- data/lib/ohai/plugins/linux/block_device.rb +19 -15
- data/lib/ohai/plugins/linux/cpu.rb +42 -38
- data/lib/ohai/plugins/linux/filesystem.rb +70 -130
- data/lib/ohai/plugins/linux/lsb.rb +35 -35
- data/lib/ohai/plugins/linux/memory.rb +65 -61
- data/lib/ohai/plugins/linux/network.rb +343 -362
- data/lib/ohai/plugins/linux/platform.rb +90 -88
- data/lib/ohai/plugins/linux/virtualization.rb +95 -90
- data/lib/ohai/plugins/lua.rb +14 -10
- data/lib/ohai/plugins/mono.rb +17 -13
- data/lib/ohai/plugins/netbsd/cpu.rb +25 -23
- data/lib/ohai/plugins/netbsd/filesystem.rb +32 -32
- data/lib/ohai/plugins/netbsd/memory.rb +59 -59
- data/lib/ohai/plugins/netbsd/network.rb +92 -88
- data/lib/ohai/plugins/netbsd/platform.rb +10 -3
- data/lib/ohai/plugins/netbsd/virtualization.rb +41 -38
- data/lib/ohai/plugins/network.rb +131 -130
- data/lib/ohai/plugins/network_listeners.rb +26 -22
- data/lib/ohai/plugins/nodejs.rb +14 -10
- data/lib/ohai/plugins/ohai.rb +11 -6
- data/lib/ohai/plugins/ohai_time.rb +6 -2
- data/lib/ohai/plugins/openbsd/cpu.rb +20 -15
- data/lib/ohai/plugins/openbsd/filesystem.rb +32 -32
- data/lib/ohai/plugins/openbsd/memory.rb +59 -59
- data/lib/ohai/plugins/openbsd/network.rb +92 -88
- data/lib/ohai/plugins/openbsd/platform.rb +10 -4
- data/lib/ohai/plugins/openbsd/virtualization.rb +41 -39
- data/lib/ohai/plugins/openstack.rb +23 -21
- data/lib/ohai/plugins/os.rb +8 -32
- data/lib/ohai/plugins/passwd.rb +27 -22
- data/lib/ohai/plugins/perl.rb +21 -16
- data/lib/ohai/plugins/php.rb +15 -12
- data/lib/ohai/plugins/platform.rb +9 -9
- data/lib/ohai/plugins/{linux/kernel.rb → ps.rb} +13 -12
- data/lib/ohai/plugins/python.rb +16 -12
- data/lib/ohai/plugins/rackspace.rb +82 -77
- data/lib/ohai/plugins/root_group.rb +13 -9
- data/lib/ohai/plugins/ruby.rb +50 -48
- data/lib/ohai/plugins/sigar/cpu.rb +21 -17
- data/lib/ohai/plugins/sigar/filesystem.rb +26 -23
- data/lib/ohai/plugins/sigar/memory.rb +17 -14
- data/lib/ohai/plugins/sigar/network.rb +133 -67
- data/lib/ohai/plugins/sigar/network_route.rb +33 -28
- data/lib/ohai/plugins/sigar/platform.rb +10 -6
- data/lib/ohai/plugins/solaris2/cpu.rb +41 -33
- data/lib/ohai/plugins/solaris2/dmi.rb +146 -146
- data/lib/ohai/plugins/solaris2/filesystem.rb +74 -77
- data/lib/ohai/plugins/{aix/hostname.rb → solaris2/memory.rb} +7 -4
- data/lib/ohai/plugins/solaris2/network.rb +91 -86
- data/lib/ohai/plugins/solaris2/platform.rb +40 -36
- data/lib/ohai/plugins/solaris2/virtualization.rb +54 -59
- data/lib/ohai/plugins/solaris2/zpools.rb +38 -38
- data/lib/ohai/plugins/ssh_host_key.rb +49 -45
- data/lib/ohai/plugins/uptime.rb +87 -25
- data/lib/ohai/plugins/virtualization.rb +59 -55
- data/lib/ohai/plugins/windows/cpu.rb +44 -40
- data/lib/ohai/plugins/windows/filesystem.rb +28 -22
- data/lib/ohai/plugins/windows/network.rb +88 -79
- data/lib/ohai/plugins/windows/platform.rb +10 -3
- data/lib/ohai/provides_map.rb +184 -0
- data/lib/ohai/runner.rb +109 -0
- data/lib/ohai/system.rb +103 -184
- data/lib/ohai/version.rb +4 -3
- data/spec/data/plugins/___lib64___libc.so.6.output +135 -0
- data/spec/data/plugins/___lib___libc.so.6.output +135 -0
- data/spec/data/plugins/cc.output +135 -0
- data/spec/data/plugins/cl.output +135 -0
- data/spec/data/plugins/devenv.com.output +135 -0
- data/spec/data/plugins/env.output +71 -0
- data/spec/data/plugins/erl.output +144 -0
- data/spec/data/plugins/gcc.output +135 -0
- data/spec/data/plugins/groovy.output +159 -0
- data/spec/data/plugins/java.output +143 -0
- data/spec/data/plugins/lua.output +143 -0
- data/spec/data/plugins/messages.rb +8 -0
- data/spec/data/plugins/node.output +143 -0
- data/spec/data/plugins/perl.output +143 -0
- data/spec/data/plugins/php.output +143 -0
- data/spec/data/plugins/python.output +143 -0
- data/spec/data/plugins/uname.output +71 -0
- data/spec/data/plugins/v6message.rb +2 -0
- data/spec/data/plugins/v7message.rb +7 -0
- data/spec/data/plugins/what.output +135 -0
- data/spec/data/plugins/xlc.output +135 -0
- data/spec/spec_helper.rb +52 -18
- data/spec/support/integration_helper.rb +44 -0
- data/spec/unit/dsl/plugin_spec.rb +298 -0
- data/spec/unit/hints_spec.rb +65 -0
- data/spec/unit/loader_spec.rb +226 -0
- data/spec/unit/mixin/ec2_metadata_spec.rb +9 -9
- data/spec/unit/plugins/aix/cpu_spec.rb +17 -18
- data/spec/unit/plugins/aix/filesystem_spec.rb +20 -18
- data/spec/unit/plugins/aix/hostname_spec.rb +8 -4
- data/spec/unit/plugins/aix/kernel_spec.rb +13 -12
- data/spec/unit/plugins/aix/network_spec.rb +66 -45
- data/spec/unit/plugins/aix/platform_spec.rb +11 -10
- data/spec/unit/plugins/aix/uptime_spec.rb +7 -8
- data/spec/unit/plugins/azure_spec.rb +20 -21
- data/spec/unit/plugins/c_spec.rb +88 -87
- data/spec/unit/plugins/chef_spec.rb +5 -6
- data/spec/unit/plugins/cloud_spec.rb +81 -82
- data/spec/unit/plugins/darwin/cpu_spec.rb +8 -9
- data/spec/unit/plugins/darwin/hostname_spec.rb +23 -11
- data/spec/unit/plugins/darwin/kernel_spec.rb +39 -16
- data/spec/unit/plugins/darwin/network_spec.rb +375 -378
- data/spec/unit/plugins/darwin/platform_spec.rb +23 -50
- data/spec/unit/plugins/darwin/system_profiler_spec.rb +7 -8
- data/spec/unit/plugins/dmi_spec.rb +7 -12
- data/spec/unit/plugins/ec2_spec.rb +70 -59
- data/spec/unit/plugins/erlang_spec.rb +18 -20
- data/spec/unit/plugins/eucalyptus_spec.rb +37 -33
- data/spec/unit/plugins/fail_spec.rb +276 -23
- data/spec/unit/plugins/freebsd/hostname_spec.rb +11 -9
- data/spec/unit/plugins/freebsd/kernel_spec.rb +8 -8
- data/spec/unit/plugins/freebsd/platform_spec.rb +9 -10
- data/spec/unit/plugins/freebsd/virtualization_spec.rb +32 -32
- data/spec/unit/plugins/gce_spec.rb +19 -25
- data/spec/unit/plugins/groovy_spec.rb +10 -16
- data/spec/unit/plugins/hostname_spec.rb +45 -20
- data/spec/unit/plugins/ip_scopes_spec.rb +97 -0
- data/spec/unit/plugins/java_spec.rb +145 -99
- data/spec/unit/plugins/kernel_spec.rb +51 -15
- data/spec/unit/plugins/linode_spec.rb +31 -29
- data/spec/unit/plugins/linux/cpu_spec.rb +42 -43
- data/spec/unit/plugins/linux/filesystem_spec.rb +143 -324
- data/spec/unit/plugins/linux/hostname_spec.rb +16 -23
- data/spec/unit/plugins/linux/kernel_spec.rb +22 -8
- data/spec/unit/plugins/linux/lsb_spec.rb +54 -56
- data/spec/unit/plugins/linux/network_spec.rb +196 -238
- data/spec/unit/plugins/linux/platform_spec.rb +186 -205
- data/spec/unit/plugins/linux/uptime_spec.rb +13 -25
- data/spec/unit/plugins/linux/virtualization_spec.rb +149 -129
- data/spec/unit/plugins/lua_spec.rb +12 -15
- data/spec/unit/plugins/mono_spec.rb +10 -15
- data/spec/unit/plugins/netbsd/hostname_spec.rb +17 -7
- data/spec/unit/plugins/netbsd/kernel_spec.rb +8 -8
- data/spec/unit/plugins/netbsd/platform_spec.rb +8 -10
- data/spec/unit/plugins/network_spec.rb +358 -235
- data/spec/unit/plugins/nodejs_spec.rb +13 -15
- data/spec/unit/plugins/ohai_spec.rb +3 -4
- data/spec/unit/plugins/ohai_time_spec.rb +8 -9
- data/spec/unit/plugins/openbsd/hostname_spec.rb +21 -11
- data/spec/unit/plugins/openbsd/kernel_spec.rb +8 -8
- data/spec/unit/plugins/openbsd/platform_spec.rb +6 -12
- data/spec/unit/plugins/openstack_spec.rb +214 -0
- data/spec/unit/plugins/os_spec.rb +13 -16
- data/spec/unit/plugins/passwd_spec.rb +12 -13
- data/spec/unit/plugins/perl_spec.rb +20 -44
- data/spec/unit/plugins/php_spec.rb +20 -15
- data/spec/unit/plugins/platform_spec.rb +24 -29
- data/spec/unit/plugins/python_spec.rb +13 -17
- data/spec/unit/plugins/rackspace_spec.rb +90 -57
- data/spec/unit/plugins/root_group_spec.rb +17 -19
- data/spec/unit/plugins/ruby_spec.rb +15 -16
- data/spec/unit/plugins/sigar/network_route_spec.rb +12 -13
- data/spec/unit/plugins/solaris2/cpu_spec.rb +82 -0
- data/spec/unit/plugins/solaris2/hostname_spec.rb +12 -13
- data/spec/unit/plugins/solaris2/kernel_spec.rb +11 -15
- data/{lib/ohai/plugins/openbsd/uptime.rb → spec/unit/plugins/solaris2/memory_spec.rb} +10 -12
- data/spec/unit/plugins/solaris2/network_spec.rb +44 -20
- data/spec/unit/plugins/solaris2/platform_spec.rb +13 -22
- data/spec/unit/plugins/solaris2/virtualization_spec.rb +37 -45
- data/spec/unit/plugins/ssh_host_keys_spec.rb +11 -15
- data/spec/unit/provides_map_spec.rb +208 -0
- data/spec/unit/runner_spec.rb +488 -0
- data/spec/unit/system_spec.rb +639 -104
- metadata +151 -87
- checksums.yaml +0 -7
- data/lib/ohai/mixin/from_file.rb +0 -36
- data/lib/ohai/plugins/aix/ps.rb +0 -23
- data/lib/ohai/plugins/darwin/kernel.rb +0 -37
- data/lib/ohai/plugins/darwin/ps.rb +0 -23
- data/lib/ohai/plugins/darwin/uptime.rb +0 -32
- data/lib/ohai/plugins/dmi_common.rb +0 -121
- data/lib/ohai/plugins/freebsd/hostname.rb +0 -22
- data/lib/ohai/plugins/freebsd/kernel.rb +0 -37
- data/lib/ohai/plugins/freebsd/ps.rb +0 -24
- data/lib/ohai/plugins/hpux/cpu.rb +0 -19
- data/lib/ohai/plugins/hpux/filesystem.rb +0 -19
- data/lib/ohai/plugins/hpux/hostname.rb +0 -19
- data/lib/ohai/plugins/hpux/memory.rb +0 -19
- data/lib/ohai/plugins/hpux/network.rb +0 -19
- data/lib/ohai/plugins/hpux/platform.rb +0 -19
- data/lib/ohai/plugins/hpux/ps.rb +0 -23
- data/lib/ohai/plugins/hpux/uptime.rb +0 -19
- data/lib/ohai/plugins/linux/hostname.rb +0 -40
- data/lib/ohai/plugins/linux/ps.rb +0 -23
- data/lib/ohai/plugins/linux/uptime.rb +0 -28
- data/lib/ohai/plugins/netbsd/hostname.rb +0 -22
- data/lib/ohai/plugins/netbsd/kernel.rb +0 -35
- data/lib/ohai/plugins/netbsd/ps.rb +0 -24
- data/lib/ohai/plugins/netbsd/uptime.rb +0 -31
- data/lib/ohai/plugins/openbsd/hostname.rb +0 -22
- data/lib/ohai/plugins/openbsd/kernel.rb +0 -35
- data/lib/ohai/plugins/openbsd/ps.rb +0 -24
- data/lib/ohai/plugins/sigar/hostname.rb +0 -28
- data/lib/ohai/plugins/sigar/uptime.rb +0 -27
- data/lib/ohai/plugins/solaris2/hostname.rb +0 -34
- data/lib/ohai/plugins/solaris2/kernel.rb +0 -40
- data/lib/ohai/plugins/solaris2/ps.rb +0 -23
- data/lib/ohai/plugins/solaris2/uptime.rb +0 -36
- data/lib/ohai/plugins/windows/hostname.rb +0 -33
- data/lib/ohai/plugins/windows/kernel.rb +0 -58
- data/lib/ohai/plugins/windows/kernel_devices.rb +0 -39
- data/lib/ohai/plugins/windows/uptime.rb +0 -23
- data/spec/unit/mixin/from_file_spec.rb +0 -53
@@ -16,10 +16,13 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
|
19
|
+
Ohai.plugin(:Platform) do
|
20
|
+
provides "platform", "platform_version", "platform_family"
|
21
|
+
depends "kernel"
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
collect_data(:aix) do
|
24
|
+
platform kernel[:name]
|
25
|
+
platform_version [kernel[:version], kernel[:release]].join(".")
|
26
|
+
platform_family platform
|
27
|
+
end
|
28
|
+
end
|
@@ -15,20 +15,22 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
-
require 'date'
|
19
18
|
|
20
|
-
|
19
|
+
Ohai.plugin(:Uptime) do
|
20
|
+
provides "uptime", "uptime_seconds"
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
#
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
collect_data(:aix) do
|
23
|
+
require 'date'
|
24
|
+
# Example output:
|
25
|
+
# $ who -b
|
26
|
+
# . system boot Jul 9 17:51
|
27
|
+
so = shell_out('who -b')
|
28
|
+
so.stdout.lines.each do |line|
|
29
|
+
if line =~ /.* boot (.+)/
|
30
|
+
uptime_seconds Time.now.to_i - DateTime.parse($1).strftime('%s').to_i
|
31
|
+
uptime seconds_to_human(uptime_seconds)
|
32
|
+
break
|
33
|
+
end
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
data/lib/ohai/plugins/azure.rb
CHANGED
@@ -1,13 +1,35 @@
|
|
1
|
+
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
2
|
+
# License:: Apache License, Version 2.0
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
1
16
|
|
2
|
-
|
17
|
+
Ohai.plugin(:Azure) do
|
18
|
+
provides "azure"
|
3
19
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
20
|
+
collect_data do
|
21
|
+
# The azure hints are populated by the knife plugin for Azure.
|
22
|
+
# The project is located at https://github.com/opscode/knife-azure
|
23
|
+
# Please see the lib/chef/knife/azure_server_create.rb file in that
|
24
|
+
# project for details
|
25
|
+
azure_metadata_from_hints = hint?('azure')
|
26
|
+
if azure_metadata_from_hints
|
27
|
+
Ohai::Log.debug("azure_metadata_from_hints is present.")
|
28
|
+
azure Mash.new
|
29
|
+
azure_metadata_from_hints.each {|k, v| azure[k] = v }
|
30
|
+
else
|
31
|
+
Ohai::Log.debug("No hints present for azure.")
|
32
|
+
false
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/ohai/plugins/c.rb
CHANGED
@@ -18,93 +18,118 @@
|
|
18
18
|
|
19
19
|
require 'rbconfig'
|
20
20
|
|
21
|
-
|
21
|
+
Ohai.plugin(:C) do
|
22
|
+
provides "languages/c"
|
22
23
|
|
23
|
-
|
24
|
+
depends "languages"
|
24
25
|
|
25
|
-
|
26
|
+
collect_data do
|
27
|
+
c = Mash.new
|
26
28
|
|
27
|
-
#gcc
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
29
|
+
#gcc
|
30
|
+
begin
|
31
|
+
so = shell_out("gcc -v")
|
32
|
+
if so.exitstatus == 0
|
33
|
+
description = so.stderr.split($/).last
|
34
|
+
output = description.split
|
35
|
+
if output.length >= 3
|
36
|
+
c[:gcc] = Mash.new
|
37
|
+
c[:gcc][:version] = output[2]
|
38
|
+
c[:gcc][:description] = description
|
39
|
+
end
|
40
|
+
end
|
41
|
+
rescue Errno::ENOENT
|
42
|
+
end
|
38
43
|
|
39
|
-
#glibc
|
40
|
-
["/lib/libc.so.6", "/lib64/libc.so.6"].each do |glibc|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
#glibc
|
45
|
+
["/lib/libc.so.6", "/lib64/libc.so.6"].each do |glibc|
|
46
|
+
begin
|
47
|
+
so = shell_out( Ohai.abs_path( glibc ))
|
48
|
+
if so.exitstatus == 0
|
49
|
+
description = so.stdout.split($/).first
|
50
|
+
if description =~ /(\d+\.\d+\.?\d*)/
|
51
|
+
c[:glibc] = Mash.new
|
52
|
+
c[:glibc][:version] = $1
|
53
|
+
c[:glibc][:description] = description
|
54
|
+
end
|
55
|
+
break
|
56
|
+
end
|
57
|
+
rescue Errno::ENOENT
|
58
|
+
end
|
48
59
|
end
|
49
|
-
break
|
50
|
-
end
|
51
|
-
end
|
52
60
|
|
53
|
-
#ms cl
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
end
|
61
|
+
#ms cl
|
62
|
+
begin
|
63
|
+
so = shell_out("cl /?")
|
64
|
+
if so.exitstatus == 0
|
65
|
+
description = so.stderr.lines.first.chomp
|
66
|
+
if description =~ /Compiler Version ([\d\.]+)/
|
67
|
+
c[:cl] = Mash.new
|
68
|
+
c[:cl][:version] = $1
|
69
|
+
c[:cl][:description] = description
|
70
|
+
end
|
71
|
+
end
|
72
|
+
rescue Errno::ENOENT
|
73
|
+
end
|
63
74
|
|
64
|
-
#ms vs
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
end
|
75
|
+
#ms vs
|
76
|
+
begin
|
77
|
+
so = shell_out("devenv.com /?")
|
78
|
+
if so.exitstatus == 0
|
79
|
+
lines = so.stdout.split($/)
|
80
|
+
description = lines[0].length == 0 ? lines[1] : lines[0]
|
81
|
+
if description =~ /Visual Studio Version ([\d\.]+)/
|
82
|
+
c[:vs] = Mash.new
|
83
|
+
c[:vs][:version] = $1.chop
|
84
|
+
c[:vs][:description] = description
|
85
|
+
end
|
86
|
+
end
|
87
|
+
rescue Errno::ENOENT
|
88
|
+
end
|
75
89
|
|
76
|
-
#ibm xlc
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
end
|
90
|
+
#ibm xlc
|
91
|
+
begin
|
92
|
+
so = shell_out("xlc -qversion")
|
93
|
+
if so.exitstatus == 0 or (so.exitstatus >> 8) == 249
|
94
|
+
description = so.stdout.split($/).first
|
95
|
+
if description =~ /V(\d+\.\d+)/
|
96
|
+
c[:xlc] = Mash.new
|
97
|
+
c[:xlc][:version] = $1
|
98
|
+
c[:xlc][:description] = description.strip
|
99
|
+
end
|
100
|
+
end
|
101
|
+
rescue Errno::ENOENT
|
102
|
+
end
|
86
103
|
|
87
|
-
#sun pro
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
end
|
104
|
+
#sun pro
|
105
|
+
begin
|
106
|
+
so = shell_out("cc -V -flags")
|
107
|
+
if so.exitstatus == 0
|
108
|
+
output = so.stderr.split
|
109
|
+
if so.stderr =~ /^cc: Sun C/ && output.size >= 4
|
110
|
+
c[:sunpro] = Mash.new
|
111
|
+
c[:sunpro][:version] = output[3]
|
112
|
+
c[:sunpro][:description] = so.stderr.chomp
|
113
|
+
end
|
114
|
+
end
|
115
|
+
rescue Errno::ENOENT
|
116
|
+
end
|
97
117
|
|
98
|
-
#hpux cc
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
118
|
+
#hpux cc
|
119
|
+
begin
|
120
|
+
so = shell_out("what /opt/ansic/bin/cc")
|
121
|
+
if so.exitstatus == 0
|
122
|
+
description = so.stdout.split($/).select { |line| line =~ /HP C Compiler/ }.first
|
123
|
+
if description
|
124
|
+
output = description.split
|
125
|
+
c[:hpcc] = Mash.new
|
126
|
+
c[:hpcc][:version] = output[1] if output.size >= 1
|
127
|
+
c[:hpcc][:description] = description.strip
|
128
|
+
end
|
129
|
+
end
|
130
|
+
rescue Errno::ENOENT
|
131
|
+
end
|
132
|
+
|
133
|
+
languages[:c] = c if c.keys.length > 0
|
107
134
|
end
|
108
135
|
end
|
109
|
-
|
110
|
-
languages[:c] = c if c.keys.length > 0
|
data/lib/ohai/plugins/chef.rb
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
14
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -16,10 +16,22 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
|
20
|
-
provides "chef"
|
19
|
+
Ohai.plugin(:Chef) do
|
20
|
+
provides "chef_packages/chef"
|
21
|
+
|
22
|
+
collect_data do
|
23
|
+
begin
|
24
|
+
require 'chef/version'
|
25
|
+
rescue Gem::LoadError
|
26
|
+
# this catches when you've done a major version bump of ohai, but
|
27
|
+
# your chef gem is incompatible, so we can't load it in the same VM
|
28
|
+
# (affects mostly internal testing)
|
29
|
+
next
|
30
|
+
end
|
21
31
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
32
|
+
chef_packages Mash.new unless chef_packages
|
33
|
+
chef_packages[:chef] = Mash.new
|
34
|
+
chef_packages[:chef][:version] = Chef::VERSION
|
35
|
+
chef_packages[:chef][:chef_root] = Chef::CHEF_ROOT
|
36
|
+
end
|
37
|
+
end
|
data/lib/ohai/plugins/cloud.rb
CHANGED
@@ -14,241 +14,245 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
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
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
interface
|
17
|
+
Ohai.plugin(:Cloud) do
|
18
|
+
provides "cloud"
|
19
|
+
|
20
|
+
depends "ec2"
|
21
|
+
depends "gce"
|
22
|
+
depends "rackspace"
|
23
|
+
depends "eucalyptus"
|
24
|
+
depends "linode"
|
25
|
+
depends "openstack"
|
26
|
+
depends "azure"
|
27
|
+
|
28
|
+
# Make top-level cloud hashes
|
29
|
+
#
|
30
|
+
def create_objects
|
31
|
+
cloud Mash.new
|
32
|
+
cloud[:public_ips] = Array.new
|
33
|
+
cloud[:private_ips] = Array.new
|
34
|
+
end
|
35
|
+
#---------------------------------------
|
36
|
+
# Google Compute Engine (gce)
|
37
|
+
#--------------------------------------
|
38
|
+
|
39
|
+
# Is current cloud gce?
|
40
|
+
#
|
41
|
+
# === Return
|
42
|
+
# true:: If gce Hash is defined
|
43
|
+
# false:: Otherwise
|
44
|
+
def on_gce?
|
45
|
+
gce != nil
|
46
|
+
end
|
47
|
+
|
48
|
+
# Fill cloud hash with gce values
|
49
|
+
def get_gce_values
|
50
|
+
cloud[:public_ipv4] = []
|
51
|
+
cloud[:local_ipv4] = []
|
52
|
+
|
53
|
+
public_ips = gce['instance']["networkInterfaces"].collect do |interface|
|
54
|
+
if interface.has_key?('accessConfigs')
|
55
|
+
interface['accessConfigs'].collect{|ac| ac['externalIp']}
|
56
|
+
end
|
57
|
+
end.flatten.compact
|
58
|
+
|
59
|
+
private_ips = gce['instance']["networkInterfaces"].collect do |interface|
|
60
|
+
interface['ip']
|
61
|
+
end.compact
|
62
|
+
|
63
|
+
cloud[:public_ips] += public_ips
|
64
|
+
cloud[:private_ips] += private_ips
|
65
|
+
cloud[:public_ipv4] += public_ips
|
66
|
+
cloud[:public_hostname] = nil
|
67
|
+
cloud[:local_ipv4] += private_ips
|
68
|
+
cloud[:local_hostname] = gce['instance']['hostname']
|
69
|
+
cloud[:provider] = "gce"
|
70
|
+
end
|
71
|
+
|
72
|
+
# ----------------------------------------
|
73
|
+
# ec2
|
74
|
+
# ----------------------------------------
|
75
|
+
|
76
|
+
# Is current cloud ec2?
|
77
|
+
#
|
78
|
+
# === Return
|
79
|
+
# true:: If ec2 Hash is defined
|
80
|
+
# false:: Otherwise
|
81
|
+
def on_ec2?
|
82
|
+
ec2 != nil
|
83
|
+
end
|
84
|
+
|
85
|
+
# Fill cloud hash with ec2 values
|
86
|
+
def get_ec2_values
|
87
|
+
cloud[:public_ips] << ec2['public_ipv4']
|
88
|
+
cloud[:private_ips] << ec2['local_ipv4']
|
89
|
+
cloud[:public_ipv4] = ec2['public_ipv4']
|
90
|
+
cloud[:public_hostname] = ec2['public_hostname']
|
91
|
+
cloud[:local_ipv4] = ec2['local_ipv4']
|
92
|
+
cloud[:local_hostname] = ec2['local_hostname']
|
93
|
+
cloud[:provider] = "ec2"
|
94
|
+
end
|
95
|
+
|
96
|
+
# ----------------------------------------
|
97
|
+
# rackspace
|
98
|
+
# ----------------------------------------
|
99
|
+
|
100
|
+
# Is current cloud rackspace?
|
101
|
+
#
|
102
|
+
# === Return
|
103
|
+
# true:: If rackspace Hash is defined
|
104
|
+
# false:: Otherwise
|
105
|
+
def on_rackspace?
|
106
|
+
rackspace != nil
|
107
|
+
end
|
108
|
+
|
109
|
+
# Fill cloud hash with rackspace values
|
110
|
+
def get_rackspace_values
|
111
|
+
cloud[:public_ips] << rackspace['public_ipv4'] if rackspace['public_ipv4']
|
112
|
+
cloud[:private_ips] << rackspace['local_ipv4'] if rackspace['local_ipv4']
|
113
|
+
cloud[:public_ipv4] = rackspace['public_ipv4']
|
114
|
+
cloud[:public_ipv6] = rackspace['public_ipv6']
|
115
|
+
cloud[:public_hostname] = rackspace['public_hostname']
|
116
|
+
cloud[:local_ipv4] = rackspace['local_ipv4']
|
117
|
+
cloud[:local_ipv6] = rackspace['local_ipv6']
|
118
|
+
cloud[:local_hostname] = rackspace['local_hostname']
|
119
|
+
cloud[:provider] = "rackspace"
|
120
|
+
end
|
121
|
+
|
122
|
+
# ----------------------------------------
|
123
|
+
# linode
|
124
|
+
# ----------------------------------------
|
125
|
+
|
126
|
+
# Is current cloud linode?
|
127
|
+
#
|
128
|
+
# === Return
|
129
|
+
# true:: If linode Hash is defined
|
130
|
+
# false:: Otherwise
|
131
|
+
def on_linode?
|
132
|
+
linode != nil
|
133
|
+
end
|
134
|
+
|
135
|
+
# Fill cloud hash with linode values
|
136
|
+
def get_linode_values
|
137
|
+
cloud[:public_ips] << linode['public_ip']
|
138
|
+
cloud[:private_ips] << linode['private_ip']
|
139
|
+
cloud[:public_ipv4] = linode['public_ipv4']
|
140
|
+
cloud[:public_hostname] = linode['public_hostname']
|
141
|
+
cloud[:local_ipv4] = linode['local_ipv4']
|
142
|
+
cloud[:local_hostname] = linode['local_hostname']
|
143
|
+
cloud[:provider] = "linode"
|
144
|
+
end
|
145
|
+
|
146
|
+
# ----------------------------------------
|
147
|
+
# eucalyptus
|
148
|
+
# ----------------------------------------
|
149
|
+
|
150
|
+
# Is current cloud eucalyptus?
|
151
|
+
#
|
152
|
+
# === Return
|
153
|
+
# true:: If eucalyptus Hash is defined
|
154
|
+
# false:: Otherwise
|
155
|
+
def on_eucalyptus?
|
156
|
+
eucalyptus != nil
|
157
|
+
end
|
158
|
+
|
159
|
+
def get_eucalyptus_values
|
160
|
+
cloud[:public_ips] << eucalyptus['public_ipv4']
|
161
|
+
cloud[:private_ips] << eucalyptus['local_ipv4']
|
162
|
+
cloud[:public_ipv4] = eucalyptus['public_ipv4']
|
163
|
+
cloud[:public_hostname] = eucalyptus['public_hostname']
|
164
|
+
cloud[:local_ipv4] = eucalyptus['local_ipv4']
|
165
|
+
cloud[:local_hostname] = eucalyptus['local_hostname']
|
166
|
+
cloud[:provider] = "eucalyptus"
|
167
|
+
end
|
168
|
+
|
169
|
+
# ----------------------------------------
|
170
|
+
# openstack
|
171
|
+
# ----------------------------------------
|
172
|
+
|
173
|
+
# Is current cloud openstack-based?
|
174
|
+
#
|
175
|
+
# === Return
|
176
|
+
# true:: If openstack Hash is defined
|
177
|
+
# false:: Otherwise
|
178
|
+
def on_openstack?
|
179
|
+
openstack != nil
|
180
|
+
end
|
181
|
+
|
182
|
+
# Fill cloud hash with openstack values
|
183
|
+
def get_openstack_values
|
184
|
+
cloud[:public_ips] << openstack['public_ipv4']
|
185
|
+
cloud[:private_ips] << openstack['local_ipv4']
|
186
|
+
cloud[:public_ipv4] = openstack['public_ipv4']
|
187
|
+
cloud[:public_hostname] = openstack['public_hostname']
|
188
|
+
cloud[:local_ipv4] = openstack['local_ipv4']
|
189
|
+
cloud[:local_hostname] = openstack['local_hostname']
|
190
|
+
cloud[:provider] = openstack['provider']
|
191
|
+
end
|
192
|
+
|
193
|
+
# ----------------------------------------
|
194
|
+
# azure
|
195
|
+
# ----------------------------------------
|
196
|
+
|
197
|
+
# Is current cloud azure?
|
198
|
+
#
|
199
|
+
# === Return
|
200
|
+
# true:: If azure Hash is defined
|
201
|
+
# false:: Otherwise
|
202
|
+
def on_azure?
|
203
|
+
azure != nil
|
204
|
+
end
|
205
|
+
|
206
|
+
# Fill cloud hash with azure values
|
207
|
+
def get_azure_values
|
208
|
+
cloud[:vm_name] = azure["vm_name"]
|
209
|
+
cloud[:public_ips] << azure['public_ip']
|
210
|
+
cloud[:public_fqdn] = azure['public_fqdn']
|
211
|
+
cloud[:public_ssh_port] = azure['public_ssh_port'] if azure['public_ssh_port']
|
212
|
+
cloud[:public_winrm_port] = azure['public_winrm_port'] if azure['public_winrm_port']
|
213
|
+
cloud[:provider] = "azure"
|
214
|
+
end
|
215
|
+
|
216
|
+
collect_data do
|
217
|
+
# setup gce cloud
|
218
|
+
if on_gce?
|
219
|
+
create_objects
|
220
|
+
get_gce_values
|
55
221
|
end
|
56
|
-
end.flatten.compact
|
57
|
-
|
58
|
-
private_ips = gce['instance']["networkInterfaces"].collect do |interface|
|
59
|
-
interface['ip']
|
60
|
-
end.compact
|
61
|
-
|
62
|
-
cloud[:public_ips] += public_ips
|
63
|
-
cloud[:private_ips] += private_ips
|
64
|
-
cloud[:public_ipv4] += public_ips
|
65
|
-
cloud[:public_hostname] = nil
|
66
|
-
cloud[:local_ipv4] += private_ips
|
67
|
-
cloud[:local_hostname] = gce['instance']['hostname']
|
68
|
-
cloud[:provider] = "gce"
|
69
|
-
end
|
70
|
-
|
71
|
-
# setup gce cloud
|
72
|
-
if on_gce?
|
73
|
-
create_objects
|
74
|
-
get_gce_values
|
75
|
-
end
|
76
|
-
|
77
|
-
# ----------------------------------------
|
78
|
-
# ec2
|
79
|
-
# ----------------------------------------
|
80
|
-
|
81
|
-
# Is current cloud ec2?
|
82
|
-
#
|
83
|
-
# === Return
|
84
|
-
# true:: If ec2 Hash is defined
|
85
|
-
# false:: Otherwise
|
86
|
-
def on_ec2?
|
87
|
-
ec2 != nil
|
88
|
-
end
|
89
|
-
|
90
|
-
# Fill cloud hash with ec2 values
|
91
|
-
def get_ec2_values
|
92
|
-
cloud[:public_ips] << ec2['public_ipv4']
|
93
|
-
cloud[:private_ips] << ec2['local_ipv4']
|
94
|
-
cloud[:public_ipv4] = ec2['public_ipv4']
|
95
|
-
cloud[:public_hostname] = ec2['public_hostname']
|
96
|
-
cloud[:local_ipv4] = ec2['local_ipv4']
|
97
|
-
cloud[:local_hostname] = ec2['local_hostname']
|
98
|
-
cloud[:provider] = "ec2"
|
99
|
-
end
|
100
|
-
|
101
|
-
# setup ec2 cloud
|
102
|
-
if on_ec2?
|
103
|
-
create_objects
|
104
|
-
get_ec2_values
|
105
|
-
end
|
106
|
-
|
107
|
-
# ----------------------------------------
|
108
|
-
# rackspace
|
109
|
-
# ----------------------------------------
|
110
222
|
|
111
|
-
#
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
def on_rackspace?
|
117
|
-
rackspace != nil
|
118
|
-
end
|
119
|
-
|
120
|
-
# Fill cloud hash with rackspace values
|
121
|
-
def get_rackspace_values
|
122
|
-
cloud[:public_ips] << rackspace['public_ipv4'] if rackspace['public_ipv4']
|
123
|
-
cloud[:private_ips] << rackspace['local_ipv4'] if rackspace['local_ipv4']
|
124
|
-
cloud[:public_ipv4] = rackspace['public_ipv4']
|
125
|
-
cloud[:public_ipv6] = rackspace['public_ipv6']
|
126
|
-
cloud[:public_hostname] = rackspace['public_hostname']
|
127
|
-
cloud[:local_ipv4] = rackspace['local_ipv4']
|
128
|
-
cloud[:local_ipv6] = rackspace['local_ipv6']
|
129
|
-
cloud[:local_hostname] = rackspace['local_hostname']
|
130
|
-
cloud[:provider] = "rackspace"
|
131
|
-
end
|
132
|
-
|
133
|
-
# setup rackspace cloud
|
134
|
-
if on_rackspace?
|
135
|
-
create_objects
|
136
|
-
get_rackspace_values
|
137
|
-
end
|
138
|
-
|
139
|
-
# ----------------------------------------
|
140
|
-
# linode
|
141
|
-
# ----------------------------------------
|
142
|
-
|
143
|
-
# Is current cloud linode?
|
144
|
-
#
|
145
|
-
# === Return
|
146
|
-
# true:: If linode Hash is defined
|
147
|
-
# false:: Otherwise
|
148
|
-
def on_linode?
|
149
|
-
linode != nil
|
150
|
-
end
|
151
|
-
|
152
|
-
# Fill cloud hash with linode values
|
153
|
-
def get_linode_values
|
154
|
-
cloud[:public_ips] << linode['public_ip']
|
155
|
-
cloud[:private_ips] << linode['private_ip']
|
156
|
-
cloud[:public_ipv4] = linode['public_ipv4']
|
157
|
-
cloud[:public_hostname] = linode['public_hostname']
|
158
|
-
cloud[:local_ipv4] = linode['local_ipv4']
|
159
|
-
cloud[:local_hostname] = linode['local_hostname']
|
160
|
-
cloud[:provider] = "linode"
|
161
|
-
end
|
162
|
-
|
163
|
-
# setup linode cloud data
|
164
|
-
if on_linode?
|
165
|
-
create_objects
|
166
|
-
get_linode_values
|
167
|
-
end
|
168
|
-
|
169
|
-
# ----------------------------------------
|
170
|
-
# eucalyptus
|
171
|
-
# ----------------------------------------
|
172
|
-
|
173
|
-
# Is current cloud eucalyptus?
|
174
|
-
#
|
175
|
-
# === Return
|
176
|
-
# true:: If eucalyptus Hash is defined
|
177
|
-
# false:: Otherwise
|
178
|
-
def on_eucalyptus?
|
179
|
-
eucalyptus != nil
|
180
|
-
end
|
181
|
-
|
182
|
-
def get_eucalyptus_values
|
183
|
-
cloud[:public_ips] << eucalyptus['public_ipv4']
|
184
|
-
cloud[:private_ips] << eucalyptus['local_ipv4']
|
185
|
-
cloud[:public_ipv4] = eucalyptus['public_ipv4']
|
186
|
-
cloud[:public_hostname] = eucalyptus['public_hostname']
|
187
|
-
cloud[:local_ipv4] = eucalyptus['local_ipv4']
|
188
|
-
cloud[:local_hostname] = eucalyptus['local_hostname']
|
189
|
-
cloud[:provider] = "eucalyptus"
|
190
|
-
end
|
191
|
-
|
192
|
-
if on_eucalyptus?
|
193
|
-
create_objects
|
194
|
-
get_eucalyptus_values
|
195
|
-
end
|
196
|
-
|
197
|
-
# ----------------------------------------
|
198
|
-
# openstack
|
199
|
-
# ----------------------------------------
|
200
|
-
|
201
|
-
# Is current cloud openstack-based?
|
202
|
-
#
|
203
|
-
# === Return
|
204
|
-
# true:: If openstack Hash is defined
|
205
|
-
# false:: Otherwise
|
206
|
-
def on_openstack?
|
207
|
-
openstack != nil
|
208
|
-
end
|
209
|
-
|
210
|
-
# Fill cloud hash with openstack values
|
211
|
-
def get_openstack_values
|
212
|
-
cloud[:public_ips] << openstack['public_ipv4']
|
213
|
-
cloud[:private_ips] << openstack['local_ipv4']
|
214
|
-
cloud[:public_ipv4] = openstack['public_ipv4']
|
215
|
-
cloud[:public_hostname] = openstack['public_hostname']
|
216
|
-
cloud[:local_ipv4] = openstack['local_ipv4']
|
217
|
-
cloud[:local_hostname] = openstack['local_hostname']
|
218
|
-
cloud[:provider] = openstack['provider']
|
219
|
-
end
|
223
|
+
# setup ec2 cloud
|
224
|
+
if on_ec2?
|
225
|
+
create_objects
|
226
|
+
get_ec2_values
|
227
|
+
end
|
220
228
|
|
221
|
-
# setup
|
222
|
-
if
|
223
|
-
|
224
|
-
|
225
|
-
end
|
229
|
+
# setup rackspace cloud
|
230
|
+
if on_rackspace?
|
231
|
+
create_objects
|
232
|
+
get_rackspace_values
|
233
|
+
end
|
226
234
|
|
227
|
-
#
|
228
|
-
|
229
|
-
|
235
|
+
# setup linode cloud data
|
236
|
+
if on_linode?
|
237
|
+
create_objects
|
238
|
+
get_linode_values
|
239
|
+
end
|
230
240
|
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
# false:: Otherwise
|
236
|
-
def on_azure?
|
237
|
-
azure != nil
|
238
|
-
end
|
241
|
+
if on_eucalyptus?
|
242
|
+
create_objects
|
243
|
+
get_eucalyptus_values
|
244
|
+
end
|
239
245
|
|
240
|
-
#
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
cloud[:public_ssh_port] = azure['public_ssh_port'] if azure['public_ssh_port']
|
246
|
-
cloud[:public_winrm_port] = azure['public_winrm_port'] if azure['public_winrm_port']
|
247
|
-
cloud[:provider] = "azure"
|
248
|
-
end
|
246
|
+
# setup openstack cloud
|
247
|
+
if on_openstack?
|
248
|
+
create_objects
|
249
|
+
get_openstack_values
|
250
|
+
end
|
249
251
|
|
250
|
-
# setup azure cloud data
|
251
|
-
if on_azure?
|
252
|
-
|
253
|
-
|
252
|
+
# setup azure cloud data
|
253
|
+
if on_azure?
|
254
|
+
create_objects
|
255
|
+
get_azure_values
|
256
|
+
end
|
257
|
+
end
|
254
258
|
end
|