facter 3.9.6.cfacter.20180612 → 3.11.0.cfacter.20180319
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/ext/facter/facter/CMakeLists.txt +1 -1
- data/ext/facter/facter/acceptance/Gemfile +3 -4
- data/ext/facter/facter/acceptance/Rakefile +342 -2
- data/ext/facter/facter/acceptance/config/aio/options.rb +6 -0
- data/ext/facter/facter/acceptance/config/git/options.rb +5 -1
- data/ext/facter/facter/acceptance/setup/aio/pre-suite/010_Install.rb +22 -0
- data/ext/facter/facter/acceptance/setup/aio/pre-suite/021_InstallAristaModule.rb +12 -0
- data/ext/facter/facter/acceptance/setup/aio/pre-suite/022_Remove_LD_PRELOAD.rb +11 -0
- data/ext/facter/facter/acceptance/setup/common/00_EnvSetup.rb +64 -0
- data/ext/facter/facter/acceptance/setup/common/pre-suite/000-delete-puppet-when-none.rb +11 -0
- data/ext/facter/facter/acceptance/setup/git/pre-suite/01_TestSetup.rb +31 -0
- data/ext/facter/facter/acceptance/tests/ticket_1238_hostname_fqdn.rb +20 -0
- data/ext/facter/facter/lib/CMakeLists.txt +3 -2
- data/ext/facter/facter/lib/Doxyfile +1 -1
- data/ext/facter/facter/lib/inc/facter/facts/fact.hpp +5 -0
- data/ext/facter/facter/lib/inc/internal/facts/aix/networking_resolver.hpp +0 -7
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp +0 -7
- data/ext/facter/facter/lib/inc/internal/facts/linux/fips_resolver.hpp +31 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/networking_resolver.hpp +0 -7
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/networking_resolver.hpp +0 -7
- data/ext/facter/facter/lib/inc/internal/facts/osx/networking_resolver.hpp +0 -7
- data/ext/facter/facter/lib/inc/internal/facts/posix/networking_resolver.hpp +0 -7
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/fips_resolver.hpp +46 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/networking_resolver.hpp +2 -3
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/ssh_resolver.hpp +6 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/networking_resolver.hpp +0 -7
- data/ext/facter/facter/lib/schema/facter.yaml +38 -18
- data/ext/facter/facter/lib/src/cwrapper.cc +5 -0
- data/ext/facter/facter/lib/src/facts/aix/disk_resolver.cc +2 -11
- data/ext/facter/facter/lib/src/facts/aix/networking_resolver.cc +0 -5
- data/ext/facter/facter/lib/src/facts/freebsd/dmi_resolver.cc +5 -1
- data/ext/facter/facter/lib/src/facts/freebsd/networking_resolver.cc +1 -10
- data/ext/facter/facter/lib/src/facts/freebsd/virtualization_resolver.cc +1 -4
- data/ext/facter/facter/lib/src/facts/linux/collection.cc +2 -0
- data/ext/facter/facter/lib/src/facts/linux/fips_resolver.cc +31 -0
- data/ext/facter/facter/lib/src/facts/linux/networking_resolver.cc +1 -10
- data/ext/facter/facter/lib/src/facts/openbsd/networking_resolver.cc +1 -10
- data/ext/facter/facter/lib/src/facts/osx/networking_resolver.cc +1 -10
- data/ext/facter/facter/lib/src/facts/posix/networking_resolver.cc +2 -3
- data/ext/facter/facter/lib/src/facts/posix/ssh_resolver.cc +3 -2
- data/ext/facter/facter/lib/src/facts/resolvers/fips_resolver.cc +23 -0
- data/ext/facter/facter/lib/src/facts/resolvers/networking_resolver.cc +7 -23
- data/ext/facter/facter/lib/src/facts/resolvers/ssh_resolver.cc +1 -0
- data/ext/facter/facter/lib/src/facts/solaris/networking_resolver.cc +0 -5
- data/ext/facter/facter/lib/tests/facts/resolvers/ssh_resolver.cc +8 -1
- data/ext/facter/facter/lib/tests/facts/schema.cc +17 -0
- data/ext/facter/facter/locales/FACTER.pot +2 -23
- data/ext/facter/leatherman/CHANGELOG.md +16 -9
- data/ext/facter/leatherman/CMakeLists.txt +1 -2
- data/ext/facter/leatherman/appveyor.yml +26 -19
- data/ext/facter/leatherman/catch/CMakeLists.txt +1 -1
- data/ext/facter/leatherman/curl/tests/client_test.cc +396 -398
- data/ext/facter/leatherman/curl/tests/mock_curl.cc +2 -0
- data/ext/facter/leatherman/curl/tests/request_test.cc +66 -68
- data/ext/facter/leatherman/curl/tests/response_test.cc +50 -52
- data/ext/facter/leatherman/dynamic_library/tests/dynamic_library_tests.cc +71 -75
- data/ext/facter/leatherman/execution/src/execution.cc +3 -0
- data/ext/facter/leatherman/execution/src/posix/execution.cc +5 -6
- data/ext/facter/leatherman/execution/src/windows/execution.cc +2 -0
- data/ext/facter/leatherman/execution/tests/windows/execution.cc +4 -2
- data/ext/facter/leatherman/file_util/tests/directory_utils_test.cc +66 -68
- data/ext/facter/leatherman/file_util/tests/file_utils_test.cc +175 -177
- data/ext/facter/leatherman/json_container/inc/leatherman/json_container/json_container.hpp +7 -0
- data/ext/facter/leatherman/json_container/src/json_container.cc +10 -1
- data/ext/facter/leatherman/json_container/tests/json_container_test.cc +152 -8
- data/ext/facter/leatherman/locale/CMakeLists.txt +0 -7
- data/ext/facter/leatherman/locales/leatherman.pot +8 -13
- data/ext/facter/leatherman/logging/src/logging.cc +2 -0
- data/ext/facter/leatherman/util/tests/timer.cc +1 -3
- data/ext/facter/leatherman/vendor/Catch-1.10.0.zip +0 -0
- data/ext/facter/leatherman/vendor/nowide/doc/Doxyfile +4 -4
- data/ext/facter/leatherman/vendor/nowide/doc/LICENSE_1_0.txt +23 -0
- data/ext/facter/leatherman/vendor/nowide/doc/main.txt +62 -54
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/convert.hpp +16 -16
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/cstdio.hpp +4 -4
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/utf8_codecvt.hpp +1 -1
- data/ext/facter/leatherman/vendor/nowide/src/iostream.cpp +32 -30
- data/ext/facter/leatherman/vendor/nowide/standalone/convert +6 -6
- data/ext/facter/leatherman/vendor/nowide/standalone/encoding_utf.hpp +1 -1
- data/ext/facter/leatherman/vendor/nowide/standalone/run_convert_and_build.sh +1 -3
- metadata +15 -6
- data/ext/facter/leatherman/cmake/FindICU.cmake +0 -690
- data/ext/facter/leatherman/scripts/travis_target.sh +0 -79
- data/ext/facter/leatherman/vendor/catch-1.4.0.zip +0 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
test_name "Setup environment"
|
2
|
+
|
3
|
+
step "Ensure Git and Ruby"
|
4
|
+
|
5
|
+
require 'puppet/acceptance/install_utils'
|
6
|
+
extend Puppet::Acceptance::InstallUtils
|
7
|
+
require 'puppet/acceptance/git_utils'
|
8
|
+
extend Puppet::Acceptance::GitUtils
|
9
|
+
require 'beaker/dsl/install_utils'
|
10
|
+
extend Beaker::DSL::InstallUtils
|
11
|
+
|
12
|
+
PACKAGES = {
|
13
|
+
:redhat => [
|
14
|
+
'git',
|
15
|
+
'ruby',
|
16
|
+
'rubygem-json',
|
17
|
+
],
|
18
|
+
:debian => [
|
19
|
+
['git', 'git-core'],
|
20
|
+
'ruby',
|
21
|
+
],
|
22
|
+
:debian_ruby18 => [
|
23
|
+
'libjson-ruby',
|
24
|
+
],
|
25
|
+
:solaris => [
|
26
|
+
['git', 'developer/versioning/git'],
|
27
|
+
['ruby', 'runtime/ruby-18'],
|
28
|
+
# there isn't a package for json, so it is installed later via gems
|
29
|
+
],
|
30
|
+
:windows => [
|
31
|
+
'git',
|
32
|
+
# there isn't a need for json on windows because it is bundled in ruby 1.9
|
33
|
+
],
|
34
|
+
}
|
35
|
+
|
36
|
+
install_packages_on(hosts, PACKAGES, :check_if_exists => true)
|
37
|
+
|
38
|
+
hosts.each do |host|
|
39
|
+
case host['platform']
|
40
|
+
when /windows/
|
41
|
+
step "#{host} Install ruby from git"
|
42
|
+
ruby_arch = host[:ruby_arch] || 'x86'
|
43
|
+
revision = if ruby_arch == 'x64'
|
44
|
+
'2.0.0-x64'
|
45
|
+
else
|
46
|
+
'1.9.3-x86'
|
47
|
+
end
|
48
|
+
|
49
|
+
install_from_git(host, "/opt/puppet-git-repos",
|
50
|
+
:name => 'puppet-win32-ruby',
|
51
|
+
:path => build_giturl('puppet-win32-ruby'),
|
52
|
+
:rev => revision)
|
53
|
+
on host, 'cd /opt/puppet-git-repos/puppet-win32-ruby; cp -r ruby/* /'
|
54
|
+
on host, 'cd /lib; icacls ruby /grant "Everyone:(OI)(CI)(RX)"'
|
55
|
+
on host, 'cd /lib; icacls ruby /reset /T'
|
56
|
+
on host, 'cd /; icacls bin /grant "Everyone:(OI)(CI)(RX)"'
|
57
|
+
on host, 'cd /; icacls bin /reset /T'
|
58
|
+
on host, 'ruby --version'
|
59
|
+
on host, 'cmd /c gem list'
|
60
|
+
when /solaris/
|
61
|
+
step "#{host} Install json from rubygems"
|
62
|
+
on host, 'gem install json'
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
test_name "Expunge puppet bits if hypervisor is none"
|
2
|
+
|
3
|
+
# Ensure that the any previous installations of puppet
|
4
|
+
# are removed from the host if it is not managed by a
|
5
|
+
# provisioning hypervisor.
|
6
|
+
|
7
|
+
hosts.each do |host|
|
8
|
+
if host[:hypervisor] == "none"
|
9
|
+
remove_puppet_on(host)
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
test_name "Install packages and repositories on target machines..." do
|
2
|
+
extend Beaker::DSL::InstallUtils
|
3
|
+
|
4
|
+
SourcePath = Beaker::DSL::InstallUtils::SourcePath
|
5
|
+
GitURI = Beaker::DSL::InstallUtils::GitURI
|
6
|
+
GitHubSig = Beaker::DSL::InstallUtils::GitHubSig
|
7
|
+
|
8
|
+
tmp_repositories = []
|
9
|
+
options[:install].each do |uri|
|
10
|
+
raise(ArgumentError, "#{uri} is not recognized.") unless(uri =~ GitURI)
|
11
|
+
tmp_repositories << extract_repo_info_from(uri)
|
12
|
+
end
|
13
|
+
|
14
|
+
repositories = order_packages(tmp_repositories)
|
15
|
+
|
16
|
+
versions = {}
|
17
|
+
hosts.each_with_index do |host, index|
|
18
|
+
on host, "echo #{GitHubSig} >> $HOME/.ssh/known_hosts"
|
19
|
+
|
20
|
+
repositories.each do |repository|
|
21
|
+
step "Install #{repository[:name]}"
|
22
|
+
install_from_git host, SourcePath, repository
|
23
|
+
|
24
|
+
if index == 1
|
25
|
+
versions[repository[:name]] = find_git_repo_versions(host,
|
26
|
+
SourcePath,
|
27
|
+
repository)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -5,6 +5,7 @@ test_name 'C93827: facter fqdn should return the hostname when its a fully quali
|
|
5
5
|
confine :except, :platform => 'windows'
|
6
6
|
|
7
7
|
fqdn = 'foo.bar.example.org'
|
8
|
+
fqdn_long = 'a23456789.b23456789.c23456789.d23456789.e23456789.f23456789.wxyz'
|
8
9
|
|
9
10
|
agents.each do |agent|
|
10
11
|
orig_hostname = on(agent, 'hostname').stdout.chomp
|
@@ -34,4 +35,23 @@ test_name 'C93827: facter fqdn should return the hostname when its a fully quali
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
end
|
38
|
+
|
39
|
+
step "long hostname as #{fqdn_long}" do
|
40
|
+
on(agent, "hostname #{fqdn_long}")
|
41
|
+
begin
|
42
|
+
Timeout.timeout(20) do
|
43
|
+
until on(agent, 'hostname').stdout =~ /#{fqdn_long}/
|
44
|
+
sleep(0.25) # on Solaris 11 hostname returns before the hostname is updated
|
45
|
+
end
|
46
|
+
end
|
47
|
+
rescue Timeout::Error
|
48
|
+
raise "Failed to reset the hostname of the test machine to #{fqdn_long}"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
step 'validate facter uses hostname as the LONG fqdn if its a fully qualified domain name' do
|
53
|
+
on(agent, 'facter fqdn') do |facter_output|
|
54
|
+
assert_equal(fqdn_long, facter_output.stdout.chomp, 'facter did not return the hostname set by the test')
|
55
|
+
end
|
56
|
+
end
|
37
57
|
end
|
@@ -36,6 +36,7 @@ set(LIBFACTER_COMMON_SOURCES
|
|
36
36
|
"src/facts/resolvers/dmi_resolver.cc"
|
37
37
|
"src/facts/resolvers/ec2_resolver.cc"
|
38
38
|
"src/facts/resolvers/filesystem_resolver.cc"
|
39
|
+
"src/facts/resolvers/fips_resolver.cc"
|
39
40
|
"src/facts/resolvers/gce_resolver.cc"
|
40
41
|
"src/facts/resolvers/hypervisors_resolver.cc"
|
41
42
|
"src/facts/resolvers/identity_resolver.cc"
|
@@ -179,6 +180,7 @@ elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
|
179
180
|
"src/facts/linux/disk_resolver.cc"
|
180
181
|
"src/facts/linux/dmi_resolver.cc"
|
181
182
|
"src/facts/linux/filesystem_resolver.cc"
|
183
|
+
"src/facts/linux/fips_resolver.cc"
|
182
184
|
"src/facts/linux/kernel_resolver.cc"
|
183
185
|
"src/facts/linux/memory_resolver.cc"
|
184
186
|
"src/facts/linux/networking_resolver.cc"
|
@@ -258,8 +260,7 @@ endif()
|
|
258
260
|
if (WIN32)
|
259
261
|
set(LIBFACTER_INSTALL_DESTINATION bin)
|
260
262
|
else()
|
261
|
-
|
262
|
-
set(LIBFACTER_INSTALL_DESTINATION lib)
|
263
|
+
set(LIBFACTER_INSTALL_DESTINATION lib${LIB_SUFFIX})
|
263
264
|
endif()
|
264
265
|
|
265
266
|
if (JRUBY_SUPPORT)
|
@@ -38,7 +38,7 @@ PROJECT_NAME = facter
|
|
38
38
|
# could be handy for archiving the generated documentation or if some version
|
39
39
|
# control system is used.
|
40
40
|
|
41
|
-
PROJECT_NUMBER = 3.
|
41
|
+
PROJECT_NUMBER = 3.11.0
|
42
42
|
|
43
43
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
44
44
|
# for a project that appears at the top of each page and should give viewer a
|
@@ -659,6 +659,11 @@ namespace facter { namespace facts {
|
|
659
659
|
* The structured fact for Solaris LDom facts.
|
660
660
|
*/
|
661
661
|
constexpr static char const* ldom = "ldom";
|
662
|
+
|
663
|
+
/**
|
664
|
+
* The fips mode fact for RHEL/Linux* facts.
|
665
|
+
*/
|
666
|
+
constexpr static char const* fips_enabled = "fips_enabled";
|
662
667
|
};
|
663
668
|
|
664
669
|
}} // namespace facter::facts
|
@@ -38,13 +38,6 @@ namespace facter { namespace facts { namespace aix {
|
|
38
38
|
*/
|
39
39
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;
|
40
40
|
|
41
|
-
/**
|
42
|
-
* Gets the length of the link address.
|
43
|
-
* @param addr The socket address representing the link address.
|
44
|
-
* @return Returns the length of the address or 0 if not a link address.
|
45
|
-
*/
|
46
|
-
virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
|
47
|
-
|
48
41
|
private:
|
49
42
|
using mtu_map = std::unordered_map<std::string, std::string>;
|
50
43
|
|
@@ -37,13 +37,6 @@ namespace facter { namespace facts { namespace freebsd {
|
|
37
37
|
* @return Returns a pointer to the address bytes or nullptr if not a link address.
|
38
38
|
*/
|
39
39
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;
|
40
|
-
|
41
|
-
/**
|
42
|
-
* Gets the length of the link address.
|
43
|
-
* @param addr The socket address representing the link address.
|
44
|
-
* @return Returns the length of the address or 0 if not a link address.
|
45
|
-
*/
|
46
|
-
virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
|
47
40
|
};
|
48
41
|
|
49
42
|
}}} // namespace facter::facts::freebsd
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* @file
|
3
|
+
* Declares the Linux fips fact resolver.
|
4
|
+
*/
|
5
|
+
#pragma once
|
6
|
+
|
7
|
+
#include "../resolvers/fips_resolver.hpp"
|
8
|
+
|
9
|
+
namespace facter { namespace facts { namespace linux {
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Responsible for resolving fips-related facts.
|
13
|
+
*/
|
14
|
+
struct fips_resolver : resolvers::fips_resolver
|
15
|
+
{
|
16
|
+
protected:
|
17
|
+
/**
|
18
|
+
* The check consists of the following.
|
19
|
+
* (1) Examining the contents of /proc/sys/crypto/fips_enabled. If it is 1
|
20
|
+
* then fips mode is enabled.
|
21
|
+
*/
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Collects the resolver data.
|
25
|
+
* @param facts The fact collection that is resolving facts.
|
26
|
+
* @return Returns the resolver data.
|
27
|
+
*/
|
28
|
+
virtual data collect_data(collection& facts) override;
|
29
|
+
};
|
30
|
+
|
31
|
+
}}} // namespace facter::facts::linux
|
@@ -40,13 +40,6 @@ namespace facter { namespace facts { namespace linux {
|
|
40
40
|
*/
|
41
41
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;
|
42
42
|
|
43
|
-
/**
|
44
|
-
* Gets the length of the link address.
|
45
|
-
* @param addr The socket address representing the link address.
|
46
|
-
* @return Returns the length of the address or 0 if not a link address.
|
47
|
-
*/
|
48
|
-
virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
|
49
|
-
|
50
43
|
/**
|
51
44
|
* Gets the MTU of the link layer data.
|
52
45
|
* @param interface The name of the link layer interface.
|
@@ -37,13 +37,6 @@ namespace facter { namespace facts { namespace openbsd {
|
|
37
37
|
* @return Returns a pointer to the address bytes or nullptr if not a link address.
|
38
38
|
*/
|
39
39
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;
|
40
|
-
|
41
|
-
/**
|
42
|
-
* Gets the length of the link address.
|
43
|
-
* @param addr The socket address representing the link address.
|
44
|
-
* @return Returns the length of the address or 0 if not a link address.
|
45
|
-
*/
|
46
|
-
virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
|
47
40
|
};
|
48
41
|
|
49
42
|
}}} // namespace facter::facts::openbsd
|
@@ -28,13 +28,6 @@ namespace facter { namespace facts { namespace osx {
|
|
28
28
|
*/
|
29
29
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;
|
30
30
|
|
31
|
-
/**
|
32
|
-
* Gets the length of the link address.
|
33
|
-
* @param addr The socket address representing the link address.
|
34
|
-
* @return Returns the length of the address or 0 if not a link address.
|
35
|
-
*/
|
36
|
-
virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
|
37
|
-
|
38
31
|
/**
|
39
32
|
* Gets the MTU of the link layer data.
|
40
33
|
* @param interface The name of the link layer interface.
|
@@ -37,13 +37,6 @@ namespace facter { namespace facts { namespace posix {
|
|
37
37
|
*/
|
38
38
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const = 0;
|
39
39
|
|
40
|
-
/**
|
41
|
-
* Gets the length of the link address.
|
42
|
-
* @param addr The socket address representing the link address.
|
43
|
-
* @return Returns the length of the address or 0 if not a link address.
|
44
|
-
*/
|
45
|
-
virtual uint8_t get_link_address_length(sockaddr const* addr) const = 0;
|
46
|
-
|
47
40
|
/**
|
48
41
|
* Collects the resolver data.
|
49
42
|
* @param facts The fact collection that is resolving facts.
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/**
|
2
|
+
* @file
|
3
|
+
* Declares the base fips fact resolver.
|
4
|
+
*/
|
5
|
+
#pragma once
|
6
|
+
|
7
|
+
#include <facter/facts/resolver.hpp>
|
8
|
+
|
9
|
+
namespace facter { namespace facts { namespace resolvers {
|
10
|
+
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Responsible for resolving fips facts.
|
14
|
+
*/
|
15
|
+
struct fips_resolver : resolver
|
16
|
+
{
|
17
|
+
fips_resolver();
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Called to resolve all facts the resolver is responsible for.
|
21
|
+
* @param facts The fact collection that is resolving facts.
|
22
|
+
*/
|
23
|
+
virtual void resolve(collection& facts) override;
|
24
|
+
|
25
|
+
protected:
|
26
|
+
/**
|
27
|
+
* Represents fips data.
|
28
|
+
*/
|
29
|
+
struct data
|
30
|
+
{
|
31
|
+
/**
|
32
|
+
* Stores the is_fips_mode_enabled data.
|
33
|
+
*/
|
34
|
+
bool is_fips_mode_enabled;
|
35
|
+
};
|
36
|
+
|
37
|
+
/**
|
38
|
+
*
|
39
|
+
* Collects fips data.
|
40
|
+
* @param facts The fact collection that is resolving facts.
|
41
|
+
* @return Returns the fips data.
|
42
|
+
*/
|
43
|
+
virtual data collect_data(collection& facts) = 0;
|
44
|
+
};
|
45
|
+
|
46
|
+
}}} // namespace facter::facts::resolvers
|
@@ -24,11 +24,10 @@ namespace facter { namespace facts { namespace resolvers {
|
|
24
24
|
|
25
25
|
/**
|
26
26
|
* Utility function to convert the bytes of a MAC address to a string.
|
27
|
-
* @param bytes The bytes of the MAC address;
|
28
|
-
* @param byte_count The number of bytes in the MAC address; defaults to be 6 bytes long.
|
27
|
+
* @param bytes The bytes of the MAC address; expected to be 6 bytes long.
|
29
28
|
* @returns Returns the MAC address as a string or an empty string if the address is the "NULL" MAC address.
|
30
29
|
*/
|
31
|
-
static std::string macaddress_to_string(uint8_t const* bytes
|
30
|
+
static std::string macaddress_to_string(uint8_t const* bytes);
|
32
31
|
|
33
32
|
/**
|
34
33
|
* Returns whether the address is an ignored IPv4 address.
|
@@ -57,6 +57,12 @@ namespace facter { namespace facts { namespace resolvers {
|
|
57
57
|
* Stores the SSH key's fingerprint.
|
58
58
|
*/
|
59
59
|
fingerprint digest;
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Stores the SSH key type. One of ssh-dss, ssh-rsa, ssh-ed25519,
|
63
|
+
* ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, or ecdsa-sha2-nistp512
|
64
|
+
*/
|
65
|
+
std::string type;
|
60
66
|
};
|
61
67
|
|
62
68
|
/**
|
@@ -37,13 +37,6 @@ namespace facter { namespace facts { namespace solaris {
|
|
37
37
|
*/
|
38
38
|
virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;
|
39
39
|
|
40
|
-
/**
|
41
|
-
* Gets the length of the link address.
|
42
|
-
* @param addr The socket address representing the link address.
|
43
|
-
* @return Returns the length of the address or 0 if not a link address.
|
44
|
-
*/
|
45
|
-
virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
|
46
|
-
|
47
40
|
private:
|
48
41
|
void populate_binding(interface& iface, lifreq const* addr) const;
|
49
42
|
void populate_macaddress(interface& iface, lifreq const* addr) const;
|
@@ -234,7 +234,7 @@ disks:
|
|
234
234
|
caveats: Only present on Solaris.
|
235
235
|
size:
|
236
236
|
type: string
|
237
|
-
description: The display size of the disk or block device
|
237
|
+
description: The display size of the disk or block device, such as "1 GiB".
|
238
238
|
size_bytes:
|
239
239
|
type: integer
|
240
240
|
description: The size of the disk or block device, in bytes.
|
@@ -369,6 +369,14 @@ filesystems:
|
|
369
369
|
Mac OSX: The usable file systems is limited to the file system of mounted devices.
|
370
370
|
blockgroup: file system
|
371
371
|
|
372
|
+
fips_enabled:
|
373
|
+
type: boolean
|
374
|
+
description: Return whether the platform is in FIPS mode
|
375
|
+
resolution: |
|
376
|
+
Linux: parse the contents of `/proc/sys/crypto/fips_enabled` which if non-zero indicates fips mode has been enabled.
|
377
|
+
caveats: |
|
378
|
+
Linux: Limited to linux redhat family only
|
379
|
+
|
372
380
|
fqdn:
|
373
381
|
type: string
|
374
382
|
hidden: true
|
@@ -722,7 +730,7 @@ memory:
|
|
722
730
|
elements:
|
723
731
|
available:
|
724
732
|
type: string
|
725
|
-
description: The display size of the available amount of swap memory
|
733
|
+
description: The display size of the available amount of swap memory, such as "1 GiB".
|
726
734
|
available_bytes:
|
727
735
|
type: integer
|
728
736
|
description: The size of the available amount of swap memory, in bytes.
|
@@ -734,13 +742,13 @@ memory:
|
|
734
742
|
description: True if the swap is encrypted or false if not.
|
735
743
|
total:
|
736
744
|
type: string
|
737
|
-
description: The display size of the total amount of swap memory
|
745
|
+
description: The display size of the total amount of swap memory, such as "1 GiB".
|
738
746
|
total_bytes:
|
739
747
|
type: integer
|
740
748
|
description: The size of the total amount of swap memory, in bytes.
|
741
749
|
used:
|
742
750
|
type: string
|
743
|
-
description: The display size of the used amount of swap memory
|
751
|
+
description: The display size of the used amount of swap memory, such as "1 GiB".
|
744
752
|
used_bytes:
|
745
753
|
type: integer
|
746
754
|
description: The size of the used amount of swap memory, in bytes.
|
@@ -750,7 +758,7 @@ memory:
|
|
750
758
|
elements:
|
751
759
|
available:
|
752
760
|
type: string
|
753
|
-
description: The display size of the available amount of system memory
|
761
|
+
description: The display size of the available amount of system memory, such as "1 GiB".
|
754
762
|
available_bytes:
|
755
763
|
type: integer
|
756
764
|
description: The size of the available amount of system memory, in bytes.
|
@@ -759,13 +767,13 @@ memory:
|
|
759
767
|
description: The capacity percentage (0% is empty, 100% is full).
|
760
768
|
total:
|
761
769
|
type: string
|
762
|
-
description: The display size of the total amount of system memory
|
770
|
+
description: The display size of the total amount of system memory, such as "1 GiB".
|
763
771
|
total_bytes:
|
764
772
|
type: integer
|
765
773
|
description: The size of the total amount of system memory, in bytes.
|
766
774
|
used:
|
767
775
|
type: string
|
768
|
-
description: The display size of the used amount of system memory
|
776
|
+
description: The display size of the used amount of system memory, such as "1 GiB".
|
769
777
|
used_bytes:
|
770
778
|
type: integer
|
771
779
|
description: The size of the used amount of system memory, in bytes.
|
@@ -773,7 +781,7 @@ memory:
|
|
773
781
|
memoryfree:
|
774
782
|
type: string
|
775
783
|
hidden: true
|
776
|
-
description: Return the display size of the free system memory
|
784
|
+
description: Return the display size of the free system memory, such as "1 GiB".
|
777
785
|
resolution: |
|
778
786
|
Linux: parse the contents of `/proc/meminfo` to retrieve the free system memory.
|
779
787
|
Mac OSX: use the `sysctl` function to retrieve the free system memory.
|
@@ -793,7 +801,7 @@ memoryfree_mb:
|
|
793
801
|
memorysize:
|
794
802
|
type: string
|
795
803
|
hidden: true
|
796
|
-
description: Return the display size of the total system memory
|
804
|
+
description: Return the display size of the total system memory, such as "1 GiB".
|
797
805
|
resolution: |
|
798
806
|
Linux: parse the contents of `/proc/meminfo` to retrieve the total system memory.
|
799
807
|
Mac OSX: use the `sysctl` function to retrieve the total system memory.
|
@@ -827,7 +835,7 @@ mountpoints:
|
|
827
835
|
elements:
|
828
836
|
available:
|
829
837
|
type: string
|
830
|
-
description: The display size of the available space
|
838
|
+
description: The display size of the available space, such as "1 GiB".
|
831
839
|
available_bytes:
|
832
840
|
type: integer
|
833
841
|
description: The size of the available space, in bytes.
|
@@ -845,13 +853,13 @@ mountpoints:
|
|
845
853
|
description: The mount options.
|
846
854
|
size:
|
847
855
|
type: string
|
848
|
-
description: The display size of the total space
|
856
|
+
description: The display size of the total space, such as "1 GiB".
|
849
857
|
size_bytes:
|
850
858
|
type: integer
|
851
859
|
description: The size of the total space, in bytes.
|
852
860
|
used:
|
853
861
|
type: string
|
854
|
-
description: The display size of the used space
|
862
|
+
description: The display size of the used space, such as "1 GiB".
|
855
863
|
used_bytes:
|
856
864
|
type: integer
|
857
865
|
description: The size of the used space, in bytes.
|
@@ -1066,7 +1074,7 @@ operatingsystemmajrelease:
|
|
1066
1074
|
Solaris: parse the contents of `/etc/release` to retrieve the OS major release.
|
1067
1075
|
Windows: use WMI to retrieve the OS major release.
|
1068
1076
|
caveats: |
|
1069
|
-
Linux: for Ubuntu, the major release is X.Y
|
1077
|
+
Linux: for Ubuntu, the major release is X.Y, such as "10.4".
|
1070
1078
|
|
1071
1079
|
operatingsystemrelease:
|
1072
1080
|
type: string
|
@@ -1204,7 +1212,7 @@ osfamily:
|
|
1204
1212
|
description: Return the family of the operating system.
|
1205
1213
|
resolution: |
|
1206
1214
|
All platforms: default to the kernel name.
|
1207
|
-
Linux: map various Linux distributions to their base distribution
|
1215
|
+
Linux: map various Linux distributions to their base distribution. For example, Ubuntu is a "Debian" distro.
|
1208
1216
|
Solaris: map various Solaris-based operating systems to the "Solaris" family.
|
1209
1217
|
Windows: use "windows" as the family name.
|
1210
1218
|
|
@@ -1240,7 +1248,7 @@ partitions:
|
|
1240
1248
|
description: The unique identifier of a GPT partition.
|
1241
1249
|
size:
|
1242
1250
|
type: string
|
1243
|
-
description: The display size of the partition
|
1251
|
+
description: The display size of the partition, such as "1 GiB".
|
1244
1252
|
size_bytes:
|
1245
1253
|
type: integer
|
1246
1254
|
description: The size of the partition, in bytes.
|
@@ -1315,7 +1323,7 @@ processors:
|
|
1315
1323
|
description: The count of physical processors.
|
1316
1324
|
speed:
|
1317
1325
|
type: string
|
1318
|
-
description: The speed of the processors
|
1326
|
+
description: The speed of the processors, such as "2.0 GHz".
|
1319
1327
|
|
1320
1328
|
productname:
|
1321
1329
|
type: string
|
@@ -1497,6 +1505,9 @@ ssh:
|
|
1497
1505
|
key:
|
1498
1506
|
type: string
|
1499
1507
|
description: The DSA public key.
|
1508
|
+
type:
|
1509
|
+
type: string
|
1510
|
+
description: The exact type of the key, i.e. "ssh-dss".
|
1500
1511
|
ecdsa:
|
1501
1512
|
type: map
|
1502
1513
|
description: Represents the public key and fingerprints for the ECDSA algorithm.
|
@@ -1514,6 +1525,9 @@ ssh:
|
|
1514
1525
|
key:
|
1515
1526
|
type: string
|
1516
1527
|
description: The ECDSA public key.
|
1528
|
+
type:
|
1529
|
+
type: string
|
1530
|
+
description: The exact type of the key, e.g. "ecdsa-sha2-nistp256".
|
1517
1531
|
ed25519:
|
1518
1532
|
type: map
|
1519
1533
|
description: Represents the public key and fingerprints for the Ed25519 algorithm.
|
@@ -1531,6 +1545,9 @@ ssh:
|
|
1531
1545
|
key:
|
1532
1546
|
type: string
|
1533
1547
|
description: The Ed25519 public key.
|
1548
|
+
type:
|
1549
|
+
type: string
|
1550
|
+
description: The exact type of the key, i.e. "ssh-ed25519".
|
1534
1551
|
rsa:
|
1535
1552
|
type: map
|
1536
1553
|
description: Represents the public key and fingerprints for the RSA algorithm.
|
@@ -1548,6 +1565,9 @@ ssh:
|
|
1548
1565
|
key:
|
1549
1566
|
type: string
|
1550
1567
|
description: The RSA public key.
|
1568
|
+
type:
|
1569
|
+
type: string
|
1570
|
+
description: The exact type of the key, i.e. "ssh-rsa".
|
1551
1571
|
|
1552
1572
|
ssh<algorithm>key:
|
1553
1573
|
pattern: ^ssh\w*key$
|
@@ -1579,7 +1599,7 @@ swapencrypted:
|
|
1579
1599
|
swapfree:
|
1580
1600
|
type: string
|
1581
1601
|
hidden: true
|
1582
|
-
description: Return the display size of the free swap memory
|
1602
|
+
description: Return the display size of the free swap memory, such as "1 GiB".
|
1583
1603
|
resolution: |
|
1584
1604
|
Linux: parse the contents of `/proc/meminfo` to retrieve the free swap memory.
|
1585
1605
|
Mac OSX: use the `sysctl` function to retrieve the free swap memory.
|
@@ -1597,7 +1617,7 @@ swapfree_mb:
|
|
1597
1617
|
swapsize:
|
1598
1618
|
type: string
|
1599
1619
|
hidden: true
|
1600
|
-
description: Return the display size of the total swap memory
|
1620
|
+
description: Return the display size of the total swap memory, such as "1 GiB".
|
1601
1621
|
resolution: |
|
1602
1622
|
Linux: parse the contents of `/proc/meminfo` to retrieve the total swap memory.
|
1603
1623
|
Mac OSX: use the `sysctl` function to retrieve the total swap memory.
|