openfact 5.5.0 → 5.6.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/facter/resolvers/linux/containers.rb +2 -0
- data/lib/facter/resolvers/networking.rb +24 -0
- data/lib/facter/resolvers/openbsd/mountpoints.rb +16 -6
- data/lib/facter/resolvers/os_release.rb +1 -1
- data/lib/facter/resolvers/uname.rb +4 -0
- data/lib/facter/templates/man.erb +1 -0
- data/lib/facter/version.rb +1 -1
- metadata +2 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3fdc83613216713995aacb8bef6ea8008a3b8b9277b0610b287018f383b55e10
|
|
4
|
+
data.tar.gz: 20ece7058ec2e2a7a7cdbc1c1bcf1e7ba6a26a5a41176585fa6db78eff408e6d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe067a98010b19cd04111185910c812ed6bdc88043472d3ee0dfdaf2f007a3be6e8ac7b7ed0a15aba113be462af88680b38224b420721b538349e1b44a92b7e8
|
|
7
|
+
data.tar.gz: 6f9cde5ea04f05113f0fcd0efb338e758f637f8e10aa46253cf8980a5c2e1b881d037ef0742e43dd21bfba43998296ff1aca5f63f1f19c43c0856d134e0ac53f
|
|
@@ -49,8 +49,12 @@ module Facter
|
|
|
49
49
|
interfaces_data.each do |interface_name, raw_data|
|
|
50
50
|
parsed_interface_data = {}
|
|
51
51
|
|
|
52
|
+
extract_flags(raw_data, parsed_interface_data)
|
|
53
|
+
extract_rdomain(raw_data, parsed_interface_data)
|
|
52
54
|
extract_mtu(raw_data, parsed_interface_data)
|
|
53
55
|
extract_mac(raw_data, parsed_interface_data)
|
|
56
|
+
extract_description(raw_data, parsed_interface_data)
|
|
57
|
+
extract_groups(raw_data, parsed_interface_data)
|
|
54
58
|
extract_dhcp(interface_name, raw_data, parsed_interface_data)
|
|
55
59
|
extract_ip_data(raw_data, parsed_interface_data)
|
|
56
60
|
|
|
@@ -59,11 +63,31 @@ module Facter
|
|
|
59
63
|
@fact_list[:interfaces] = parsed_interfaces_data unless parsed_interfaces_data.empty?
|
|
60
64
|
end
|
|
61
65
|
|
|
66
|
+
def extract_flags(raw_data, parsed_interface_data)
|
|
67
|
+
flags = raw_data.match(/flags=\h+<(.+)>/)&.captures&.first
|
|
68
|
+
parsed_interface_data[:flags] = flags.split(',') unless flags.nil?
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def extract_rdomain(raw_data, parsed_interface_data)
|
|
72
|
+
rdomain = raw_data.match(/rdomain\s+(\d+)/)&.captures&.first&.to_i
|
|
73
|
+
parsed_interface_data[:rdomain] = rdomain unless rdomain.nil?
|
|
74
|
+
end
|
|
75
|
+
|
|
62
76
|
def extract_mtu(raw_data, parsed_interface_data)
|
|
63
77
|
mtu = raw_data.match(/mtu\s+(\d+)/)&.captures&.first&.to_i
|
|
64
78
|
parsed_interface_data[:mtu] = mtu unless mtu.nil?
|
|
65
79
|
end
|
|
66
80
|
|
|
81
|
+
def extract_description(raw_data, parsed_interface_data)
|
|
82
|
+
description = raw_data.match(/description:\s+(.+)/)&.captures&.first
|
|
83
|
+
parsed_interface_data[:description] = description unless description.nil?
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def extract_groups(raw_data, parsed_interface_data)
|
|
87
|
+
groups = raw_data.match(/groups:\s+(.+)/)&.captures&.first
|
|
88
|
+
parsed_interface_data[:groups] = groups.split("\s") unless groups.nil?
|
|
89
|
+
end
|
|
90
|
+
|
|
67
91
|
def extract_mac(raw_data, parsed_interface_data)
|
|
68
92
|
mac = raw_data.match(/(?:ether|lladdr)\s+((?:\w?\w:){5}\w?\w)|(?:infiniband)\s+((?:\w?\w:){19}\w?\w)/)
|
|
69
93
|
&.captures&.compact&.first
|
|
@@ -17,7 +17,7 @@ module Facter
|
|
|
17
17
|
|
|
18
18
|
def read_mount(fact_name)
|
|
19
19
|
@fact_list[:mountpoints] = {}
|
|
20
|
-
output = Facter::Core::Execution.execute('mount', logger: log)
|
|
20
|
+
output = Facter::Core::Execution.execute('mount -v', logger: log)
|
|
21
21
|
output.split("\n").map do |line|
|
|
22
22
|
add_mount_points_fact(line)
|
|
23
23
|
end
|
|
@@ -27,11 +27,21 @@ module Facter
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def add_mount_points_fact(line)
|
|
30
|
-
(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
(*tokens, options) = line.split(/\s*\(|\)\s*/, 0)
|
|
31
|
+
|
|
32
|
+
if tokens.length == 3
|
|
33
|
+
(device, duid, tokens) = tokens
|
|
34
|
+
else
|
|
35
|
+
(device, tokens) = tokens[0].split("\s", 2)
|
|
36
|
+
end
|
|
37
|
+
(_on, path, _type, filesystem) = tokens.split("\s")
|
|
38
|
+
|
|
39
|
+
@fact_list[:mountpoints][path] = {
|
|
40
|
+
device: device,
|
|
41
|
+
duid: duid,
|
|
42
|
+
filesystem: filesystem,
|
|
43
|
+
options: options.split(",\s")
|
|
44
|
+
}.compact
|
|
35
45
|
end
|
|
36
46
|
|
|
37
47
|
def retrieve_sizes_for_mounts
|
|
@@ -35,6 +35,10 @@ module Facter
|
|
|
35
35
|
@fact_list[:kernelrelease],
|
|
36
36
|
@fact_list[:kernelname],
|
|
37
37
|
@fact_list[:kernelversion] = uname_results.map(&:strip)
|
|
38
|
+
# uutils/coreutils uname does not implement -p and returns "unknown".
|
|
39
|
+
# Fall back to -m (machine), which is the procedure suggested by the
|
|
40
|
+
# uutils/coreutils developers.
|
|
41
|
+
@fact_list[:processor] = @fact_list[:machine] if @fact_list[:processor] == 'unknown'
|
|
38
42
|
else
|
|
39
43
|
log.warn('Request to uname returned no output. Uname related facts are not populated.')
|
|
40
44
|
end
|
|
@@ -32,6 +32,7 @@ Many of the command line options can also be set via the HOCON config file. This
|
|
|
32
32
|
.Bl -tag
|
|
33
33
|
.It /etc/puppetlabs/facter/facter.conf
|
|
34
34
|
A HOCON config file that can be used to specify directories for custom and external facts, set various command line options, and specify facts to block. See example below for details, or visit the [GitHub README](https://github.com/puppetlabs/puppetlabs-hocon#overview).
|
|
35
|
+
.El
|
|
35
36
|
.Sh EXAMPLES
|
|
36
37
|
Display all facts:
|
|
37
38
|
.Bd -literal -offset indent
|
data/lib/facter/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openfact
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenVox Project
|
|
@@ -1293,16 +1293,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
1293
1293
|
- - ">="
|
|
1294
1294
|
- !ruby/object:Gem::Version
|
|
1295
1295
|
version: '2.5'
|
|
1296
|
-
- - "<"
|
|
1297
|
-
- !ruby/object:Gem::Version
|
|
1298
|
-
version: '5.0'
|
|
1299
1296
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1300
1297
|
requirements:
|
|
1301
1298
|
- - ">="
|
|
1302
1299
|
- !ruby/object:Gem::Version
|
|
1303
1300
|
version: '0'
|
|
1304
1301
|
requirements: []
|
|
1305
|
-
rubygems_version: 4.0.
|
|
1302
|
+
rubygems_version: 4.0.6
|
|
1306
1303
|
specification_version: 4
|
|
1307
1304
|
summary: OpenFact, a system inventory tool
|
|
1308
1305
|
test_files: []
|