ohai 16.7.37 → 16.8.1
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.
- checksums.yaml +4 -4
- data/lib/ohai/plugins/grub2.rb +40 -0
- data/lib/ohai/plugins/linode.rb +20 -13
- data/lib/ohai/plugins/linux/lspci.rb +0 -1
- data/lib/ohai/plugins/scsi.rb +0 -1
- data/lib/ohai/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 168be10defab5e91f8da06ce4d101a461ed13a2051d4b6901c3039571c7a3066
|
4
|
+
data.tar.gz: 8783ddbdc49208974d09cfc7e708760402248719baaf2a1a8dce28e8a14902bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5781908ba60b11f68397c10693d6c084e1eb021dc5a6b1348448b712225322295cc5b510dc41e9feecbf1a463d23f47773428ce540c138b43a2c6fd9ced079a4
|
7
|
+
data.tar.gz: 50a9ba71dca6681a84536c1f443653dc4d78172ded2fffa9022ad8ed8e577a0dc3e1bc6329b021438fe3ee6d2d62d1154093928fb3fb53957df38363f0bf92c2
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# Author:: Davide Cavalca <dcavalca@fb.com>
|
4
|
+
# Copyright:: Copyright (c) 2020 Facebook
|
5
|
+
# License:: Apache License, Version 2.0
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
Ohai.plugin(:Grub2) do
|
21
|
+
provides "grub2/environment"
|
22
|
+
optional true
|
23
|
+
|
24
|
+
collect_data(:dragonflybsd, :freebsd, :linux, :netbsd) do
|
25
|
+
editenv_path = which("grub2-editenv")
|
26
|
+
if editenv_path
|
27
|
+
editenv_out = shell_out("#{editenv_path} list")
|
28
|
+
|
29
|
+
grub2 Mash.new unless grub2
|
30
|
+
grub2[:environment] ||= Mash.new
|
31
|
+
|
32
|
+
editenv_out.stdout.each_line do |line|
|
33
|
+
key, val = line.split("=", 2)
|
34
|
+
grub2[:environment][key] = val.strip
|
35
|
+
end
|
36
|
+
else
|
37
|
+
logger.trace("Plugin Grub2: Could not find grub2-editenv. Skipping plugin.")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/ohai/plugins/linode.rb
CHANGED
@@ -18,31 +18,38 @@
|
|
18
18
|
Ohai.plugin(:Linode) do
|
19
19
|
provides "linode"
|
20
20
|
|
21
|
-
depends "
|
21
|
+
depends "domain"
|
22
22
|
depends "network/interfaces"
|
23
23
|
|
24
|
-
# Checks
|
24
|
+
# Checks to see if the node is in the members.linode.com domain
|
25
25
|
#
|
26
|
-
#
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
# @return [Boolean]
|
27
|
+
#
|
28
|
+
def has_linode_domain?
|
29
|
+
domain&.include?("linode")
|
30
|
+
end
|
31
|
+
|
32
|
+
# Checks for linode mirrors in the apt sources.list file
|
33
|
+
#
|
34
|
+
# @return [Boolean]
|
35
|
+
#
|
36
|
+
def has_linode_apt_repos?
|
37
|
+
file_exist?("/etc/apt/sources.list") && file_read("/etc/apt/sources.list").include?("linode")
|
31
38
|
end
|
32
39
|
|
33
40
|
# Identifies the linode cloud by preferring the hint, then
|
34
41
|
#
|
35
|
-
#
|
42
|
+
# @return [Boolean]
|
43
|
+
#
|
36
44
|
def looks_like_linode?
|
37
|
-
hint?("linode") ||
|
45
|
+
hint?("linode") || has_linode_domain? || has_linode_apt_repos?
|
38
46
|
end
|
39
47
|
|
40
|
-
#
|
48
|
+
# Alters linode mash with new interface based on name parameter
|
41
49
|
#
|
42
|
-
#
|
43
|
-
# eth
|
50
|
+
# @param [Symbol] name Ohai name (e.g. :public_ip)
|
51
|
+
# @param [Symbol] eth Interface name (e.g. :eth0)
|
44
52
|
#
|
45
|
-
# Alters linode mash with new interface based on name parameter
|
46
53
|
def get_ip_address(name, eth)
|
47
54
|
if ( eth_iface = network[:interfaces][eth] )
|
48
55
|
eth_iface[:addresses].each do |key, info|
|
data/lib/ohai/plugins/scsi.rb
CHANGED
data/lib/ohai/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.
|
4
|
+
version: 16.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|
@@ -285,6 +285,7 @@ files:
|
|
285
285
|
- lib/ohai/plugins/gce.rb
|
286
286
|
- lib/ohai/plugins/go.rb
|
287
287
|
- lib/ohai/plugins/groovy.rb
|
288
|
+
- lib/ohai/plugins/grub2.rb
|
288
289
|
- lib/ohai/plugins/haskell.rb
|
289
290
|
- lib/ohai/plugins/hostname.rb
|
290
291
|
- lib/ohai/plugins/init_package.rb
|