facterdb 1.21.0 → 1.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +17 -0
  3. data/.github/workflows/release.yml +3 -3
  4. data/.github/workflows/test.yml +28 -5
  5. data/.rubocop.yml +5 -0
  6. data/.rubocop_todo.yml +239 -0
  7. data/CHANGELOG.md +16 -0
  8. data/Gemfile +1 -5
  9. data/README.md +124 -122
  10. data/Rakefile +56 -51
  11. data/facterdb.gemspec +7 -7
  12. data/facts/4.1/centos-7-x86_64.facts +582 -0
  13. data/facts/4.1/debian-10-x86_64.facts +519 -0
  14. data/facts/4.2/debian-12-i386.facts +593 -0
  15. data/facts/4.2/debian-12-x86_64.facts +593 -0
  16. data/facts/4.2/fedora-38-x86_64.facts +656 -0
  17. data/facts/4.3/almalinux-8-x86_64.facts +551 -0
  18. data/facts/4.3/almalinux-9-x86_64.facts +525 -0
  19. data/facts/4.3/centos-7-x86_64.facts +592 -0
  20. data/facts/4.3/debian-10-x86_64.facts +526 -0
  21. data/facts/4.3/debian-11-x86_64.facts +521 -0
  22. data/facts/4.3/debian-12-i386.facts +593 -0
  23. data/facts/4.3/debian-12-x86_64.facts +593 -0
  24. data/facts/4.3/fedora-36-x86_64.facts +507 -0
  25. data/facts/4.3/fedora-37-x86_64.facts +512 -0
  26. data/facts/4.3/fedora-38-x86_64.facts +656 -0
  27. data/facts/4.3/opensuse-15-x86_64.facts +533 -0
  28. data/facts/4.3/redhat-8-x86_64.facts +526 -0
  29. data/facts/4.3/rocky-8-x86_64.facts +545 -0
  30. data/facts/4.3/rocky-9-x86_64.facts +626 -0
  31. data/facts/4.3/sles-12-x86_64.facts +908 -0
  32. data/facts/4.3/ubuntu-18.04-x86_64.facts +557 -0
  33. data/facts/4.3/ubuntu-20.04-x86_64.facts +647 -0
  34. data/facts/4.3/ubuntu-22.04-x86_64.facts +655 -0
  35. data/facts/4.3/windows-10-x86_64.facts +182 -0
  36. data/facts/4.3/windows-11-x86_64.facts +182 -0
  37. data/facts/4.3/windows-2012 r2-x86_64.facts +179 -0
  38. data/facts/4.3/windows-2012-x86_64.facts +179 -0
  39. data/facts/4.3/windows-2016-core-x86_64.facts +181 -0
  40. data/facts/4.3/windows-2016-x86_64.facts +181 -0
  41. data/facts/4.3/windows-2019-core-x86_64.facts +181 -0
  42. data/facts/4.3/windows-2019-x86_64.facts +181 -0
  43. data/facts/4.3/windows-2022-core-x86_64.facts +183 -0
  44. data/facts/4.3/windows-2022-x86_64.facts +183 -0
  45. data/facts/4.4/almalinux-8-x86_64.facts +551 -0
  46. data/facts/4.4/almalinux-9-x86_64.facts +525 -0
  47. data/facts/4.4/centos-7-x86_64.facts +592 -0
  48. data/facts/4.4/debian-10-x86_64.facts +526 -0
  49. data/facts/4.4/debian-11-x86_64.facts +521 -0
  50. data/facts/4.4/debian-12-i386.facts +593 -0
  51. data/facts/4.4/debian-12-x86_64.facts +593 -0
  52. data/facts/4.4/fedora-36-x86_64.facts +507 -0
  53. data/facts/4.4/fedora-37-x86_64.facts +512 -0
  54. data/facts/4.4/fedora-38-x86_64.facts +656 -0
  55. data/facts/4.4/opensuse-15-x86_64.facts +514 -0
  56. data/facts/4.4/redhat-8-x86_64.facts +526 -0
  57. data/facts/4.4/rocky-8-x86_64.facts +545 -0
  58. data/facts/4.4/rocky-9-x86_64.facts +626 -0
  59. data/facts/4.4/sles-12-x86_64.facts +908 -0
  60. data/facts/4.4/ubuntu-18.04-x86_64.facts +557 -0
  61. data/facts/4.4/ubuntu-20.04-x86_64.facts +647 -0
  62. data/facts/4.4/ubuntu-22.04-x86_64.facts +655 -0
  63. data/facts/4.4/windows-10-x86_64.facts +182 -0
  64. data/facts/4.4/windows-11-x86_64.facts +186 -0
  65. data/facts/4.4/windows-2012 r2-x86_64.facts +179 -0
  66. data/facts/4.4/windows-2012-x86_64.facts +179 -0
  67. data/facts/4.4/windows-2016-core-x86_64.facts +181 -0
  68. data/facts/4.4/windows-2016-x86_64.facts +181 -0
  69. data/facts/4.4/windows-2019-core-x86_64.facts +181 -0
  70. data/facts/4.4/windows-2019-x86_64.facts +181 -0
  71. data/facts/4.4/windows-2022-core-x86_64.facts +183 -0
  72. data/facts/4.4/windows-2022-x86_64.facts +183 -0
  73. data/facts/Gemfile +3 -7
  74. data/facts/Vagrantfile +313 -298
  75. data/facts/get_facts.sh +67 -9
  76. data/lib/facterdb/bin.rb +1 -1
  77. data/lib/facterdb/version.rb +1 -1
  78. data/lib/facterdb.rb +40 -32
  79. data/rakelib/rhel_alts.rake +8 -14
  80. data/spec/facterdb_spec.rb +37 -37
  81. data/spec/facts_spec.rb +13 -7
  82. metadata +84 -6
data/spec/facts_spec.rb CHANGED
@@ -14,7 +14,7 @@ end
14
14
 
15
15
  RSpec::Matchers.define :be_valid_json do
16
16
  match do |actual|
17
- content = File.open(actual, 'rb') { |file| file.read }
17
+ content = File.binread(actual)
18
18
  valid = false
19
19
  begin
20
20
  obj = JSON.parse(content)
@@ -41,17 +41,17 @@ RSpec::Matchers.define :have_facter_version do |expected_facter_version, filepat
41
41
  end
42
42
 
43
43
  describe 'Default Facts' do
44
- before(:each) do
44
+ before do
45
45
  ENV['FACTERDB_SKIP_DEFAULTDB'] = nil
46
46
  FacterDB.instance_variable_set(:@database, nil)
47
47
  end
48
48
 
49
49
  describe 'fact files' do
50
- it 'should not contain duplicate fact sets' do
50
+ it 'does not contain duplicate fact sets' do
51
51
  # Gather all of the default files and hash the content
52
52
  file_hashes = {}
53
53
  FacterDB.default_fact_files.each do |filepath|
54
- file_hash = Digest::SHA256.hexdigest( File.open(filepath, 'rb') { |file| file.read } )
54
+ file_hash = Digest::SHA256.hexdigest(File.binread(filepath))
55
55
  file_hashes[file_hash] ||= []
56
56
  file_hashes[file_hash] << filepath
57
57
  end
@@ -67,7 +67,7 @@ describe 'Default Facts' do
67
67
  relative_path = Pathname.new(filepath).relative_path_from(project_dir).to_s
68
68
  describe relative_path do
69
69
  subject(:content) do
70
- JSON.parse(File.open(filepath, 'rb') { |file| file.read })
70
+ JSON.parse(File.binread(filepath))
71
71
  end
72
72
 
73
73
  it 'contains a valid JSON document' do
@@ -88,9 +88,11 @@ describe 'Default Facts' do
88
88
  expect(content['networking']['fqdn']).to eq('foo.example.com')
89
89
  end
90
90
  end
91
+
91
92
  it 'contains the legacy ipaddress fact' do
92
93
  expect(content['ipaddress']).to not_be_nil.and not_be_empty
93
94
  end
95
+
94
96
  it 'contains no facts from puppetlabs/stdlib' do
95
97
  expect(content['root_home']).to be_nil
96
98
  expect(content['service_provider']).to be_nil
@@ -100,21 +102,25 @@ describe 'Default Facts' do
100
102
  expect(content['pe_version']).to be_nil
101
103
  expect(content['package_provider']).to be_nil
102
104
  end
105
+
103
106
  it 'contains no facts from puppet/systemd' do
104
107
  expect(content['systemd']).to be_nil
105
108
  expect(content['systemd_version']).to be_nil
106
109
  expect(content['systemd_internal_services']).to be_nil
107
110
  end
111
+
108
112
  it 'contains a legacy hostname, domain and fqdn fact' do
109
113
  expect(content['hostname']).to eq('foo')
110
114
  expect(content['fqdn']).to eq('foo.example.com')
111
115
  expect(content['domain']).to eq('example.com')
112
116
  end
117
+
113
118
  it 'contains the legacy osfamily fact' do
114
- expect(content['osfamily']).to_not be_nil
119
+ expect(content['osfamily']).not_to be_nil
115
120
  end
121
+
116
122
  it 'contains the legacy operatingsystem fact' do
117
- expect(content['operatingsystem']).to_not be_nil
123
+ expect(content['operatingsystem']).not_to be_nil
118
124
  end
119
125
  end
120
126
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facterdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.21.0
4
+ version: 1.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-25 00:00:00.000000000 Z
11
+ date: 2023-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: pry
42
+ name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: voxpupuli-rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.0.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.0.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: facter
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -102,10 +116,13 @@ executables:
102
116
  extensions: []
103
117
  extra_rdoc_files: []
104
118
  files:
119
+ - ".github/dependabot.yml"
105
120
  - ".github/workflows/release.yml"
106
121
  - ".github/workflows/test.yml"
107
122
  - ".gitignore"
108
123
  - ".gitmodules"
124
+ - ".rubocop.yml"
125
+ - ".rubocop_todo.yml"
109
126
  - CHANGELOG.md
110
127
  - Gemfile
111
128
  - HISTORY.md
@@ -1775,6 +1792,8 @@ files:
1775
1792
  - facts/4.0/ubuntu-21.10-x86_64.facts
1776
1793
  - facts/4.1/almalinux-8-x86_64.facts
1777
1794
  - facts/4.1/almalinux-9-x86_64.facts
1795
+ - facts/4.1/centos-7-x86_64.facts
1796
+ - facts/4.1/debian-10-x86_64.facts
1778
1797
  - facts/4.1/debian-11-x86_64.facts
1779
1798
  - facts/4.1/fedora-32-x86_64.facts
1780
1799
  - facts/4.1/fedora-33-x86_64.facts
@@ -1802,6 +1821,8 @@ files:
1802
1821
  - facts/4.2/darwin-20-x86_64.facts
1803
1822
  - facts/4.2/debian-10-x86_64.facts
1804
1823
  - facts/4.2/debian-11-x86_64.facts
1824
+ - facts/4.2/debian-12-i386.facts
1825
+ - facts/4.2/debian-12-x86_64.facts
1805
1826
  - facts/4.2/debian-9-x86_64.facts
1806
1827
  - facts/4.2/fedora-32-x86_64.facts
1807
1828
  - facts/4.2/fedora-33-x86_64.facts
@@ -1809,6 +1830,7 @@ files:
1809
1830
  - facts/4.2/fedora-35-x86_64.facts
1810
1831
  - facts/4.2/fedora-36-x86_64.facts
1811
1832
  - facts/4.2/fedora-37-x86_64.facts
1833
+ - facts/4.2/fedora-38-x86_64.facts
1812
1834
  - facts/4.2/freebsd-11-x86_64.facts
1813
1835
  - facts/4.2/freebsd-12-x86_64.facts
1814
1836
  - facts/4.2/freebsd-13-x86_64.facts
@@ -1843,6 +1865,62 @@ files:
1843
1865
  - facts/4.2/windows-2019-x86_64.facts
1844
1866
  - facts/4.2/windows-2022-core-x86_64.facts
1845
1867
  - facts/4.2/windows-2022-x86_64.facts
1868
+ - facts/4.3/almalinux-8-x86_64.facts
1869
+ - facts/4.3/almalinux-9-x86_64.facts
1870
+ - facts/4.3/centos-7-x86_64.facts
1871
+ - facts/4.3/debian-10-x86_64.facts
1872
+ - facts/4.3/debian-11-x86_64.facts
1873
+ - facts/4.3/debian-12-i386.facts
1874
+ - facts/4.3/debian-12-x86_64.facts
1875
+ - facts/4.3/fedora-36-x86_64.facts
1876
+ - facts/4.3/fedora-37-x86_64.facts
1877
+ - facts/4.3/fedora-38-x86_64.facts
1878
+ - facts/4.3/opensuse-15-x86_64.facts
1879
+ - facts/4.3/redhat-8-x86_64.facts
1880
+ - facts/4.3/rocky-8-x86_64.facts
1881
+ - facts/4.3/rocky-9-x86_64.facts
1882
+ - facts/4.3/sles-12-x86_64.facts
1883
+ - facts/4.3/ubuntu-18.04-x86_64.facts
1884
+ - facts/4.3/ubuntu-20.04-x86_64.facts
1885
+ - facts/4.3/ubuntu-22.04-x86_64.facts
1886
+ - facts/4.3/windows-10-x86_64.facts
1887
+ - facts/4.3/windows-11-x86_64.facts
1888
+ - facts/4.3/windows-2012 r2-x86_64.facts
1889
+ - facts/4.3/windows-2012-x86_64.facts
1890
+ - facts/4.3/windows-2016-core-x86_64.facts
1891
+ - facts/4.3/windows-2016-x86_64.facts
1892
+ - facts/4.3/windows-2019-core-x86_64.facts
1893
+ - facts/4.3/windows-2019-x86_64.facts
1894
+ - facts/4.3/windows-2022-core-x86_64.facts
1895
+ - facts/4.3/windows-2022-x86_64.facts
1896
+ - facts/4.4/almalinux-8-x86_64.facts
1897
+ - facts/4.4/almalinux-9-x86_64.facts
1898
+ - facts/4.4/centos-7-x86_64.facts
1899
+ - facts/4.4/debian-10-x86_64.facts
1900
+ - facts/4.4/debian-11-x86_64.facts
1901
+ - facts/4.4/debian-12-i386.facts
1902
+ - facts/4.4/debian-12-x86_64.facts
1903
+ - facts/4.4/fedora-36-x86_64.facts
1904
+ - facts/4.4/fedora-37-x86_64.facts
1905
+ - facts/4.4/fedora-38-x86_64.facts
1906
+ - facts/4.4/opensuse-15-x86_64.facts
1907
+ - facts/4.4/redhat-8-x86_64.facts
1908
+ - facts/4.4/rocky-8-x86_64.facts
1909
+ - facts/4.4/rocky-9-x86_64.facts
1910
+ - facts/4.4/sles-12-x86_64.facts
1911
+ - facts/4.4/ubuntu-18.04-x86_64.facts
1912
+ - facts/4.4/ubuntu-20.04-x86_64.facts
1913
+ - facts/4.4/ubuntu-22.04-x86_64.facts
1914
+ - facts/4.4/windows-10-x86_64.facts
1915
+ - facts/4.4/windows-11-x86_64.facts
1916
+ - facts/4.4/windows-2012 r2-x86_64.facts
1917
+ - facts/4.4/windows-2012-x86_64.facts
1918
+ - facts/4.4/windows-2016-core-x86_64.facts
1919
+ - facts/4.4/windows-2016-x86_64.facts
1920
+ - facts/4.4/windows-2019-core-x86_64.facts
1921
+ - facts/4.4/windows-2019-x86_64.facts
1922
+ - facts/4.4/windows-2022-core-x86_64.facts
1923
+ - facts/4.4/windows-2022-x86_64.facts
1846
1924
  - facts/Gemfile
1847
1925
  - facts/Vagrantfile
1848
1926
  - facts/Windows_README.md
@@ -1883,14 +1961,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
1883
1961
  requirements:
1884
1962
  - - ">="
1885
1963
  - !ruby/object:Gem::Version
1886
- version: 2.5.0
1964
+ version: 2.7.0
1887
1965
  required_rubygems_version: !ruby/object:Gem::Requirement
1888
1966
  requirements:
1889
1967
  - - ">="
1890
1968
  - !ruby/object:Gem::Version
1891
1969
  version: '0'
1892
1970
  requirements: []
1893
- rubygems_version: 3.2.33
1971
+ rubygems_version: 3.4.10
1894
1972
  signing_key:
1895
1973
  specification_version: 4
1896
1974
  summary: A Database of OS facts provided by Facter