facterdb 1.12.1 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -0
  3. data/CHANGELOG.md +43 -0
  4. data/README.md +4 -2
  5. data/Rakefile +2 -0
  6. data/facterdb.gemspec +3 -0
  7. data/facts/1.6/amazon-2017-x86_64.facts +3 -3
  8. data/facts/1.6/archlinux-x86_64.facts +1 -0
  9. data/facts/1.6/fedora-19-i386.facts +1 -0
  10. data/facts/1.6/fedora-19-x86_64.facts +1 -0
  11. data/facts/1.6/ubuntu-18.04-aarch64.facts +1 -1
  12. data/facts/1.7/amazon-2017-x86_64.facts +3 -3
  13. data/facts/1.7/archlinux-x86_64.facts +1 -0
  14. data/facts/1.7/centos-9-x86_64.facts +3 -3
  15. data/facts/1.7/ubuntu-18.04-aarch64.facts +1 -1
  16. data/facts/2.0/amazon-2017-x86_64.facts +3 -3
  17. data/facts/2.0/archlinux-x86_64.facts +1 -0
  18. data/facts/2.0/centos-9-x86_64.facts +3 -3
  19. data/facts/2.0/ubuntu-18.04-aarch64.facts +3 -1
  20. data/facts/2.1/amazon-2017-x86_64.facts +9 -9
  21. data/facts/2.1/archlinux-x86_64.facts +1 -0
  22. data/facts/2.1/centos-9-x86_64.facts +3 -3
  23. data/facts/2.1/ubuntu-18.04-aarch64.facts +3 -2
  24. data/facts/2.2/amazon-2017-x86_64.facts +9 -9
  25. data/facts/2.2/archlinux-x86_64.facts +1 -0
  26. data/facts/2.2/centos-9-x86_64.facts +3 -3
  27. data/facts/2.2/sles-15-x86_64.facts +1 -0
  28. data/facts/2.2/ubuntu-18.04-aarch64.facts +3 -2
  29. data/facts/2.3/amazon-2017-x86_64.facts +9 -9
  30. data/facts/2.3/archlinux-x86_64.facts +1 -0
  31. data/facts/2.3/centos-9-x86_64.facts +3 -3
  32. data/facts/2.3/sles-15-x86_64.facts +1 -0
  33. data/facts/2.3/ubuntu-18.04-aarch64.facts +3 -2
  34. data/facts/2.4/amazon-2017-x86_64.facts +9 -9
  35. data/facts/2.4/archlinux-x86_64.facts +1 -0
  36. data/facts/2.4/centos-9-x86_64.facts +3 -3
  37. data/facts/2.4/sles-15-x86_64.facts +1 -0
  38. data/facts/2.4/ubuntu-18.04-aarch64.facts +3 -2
  39. data/facts/2.4/windows-2012 r2-x64.facts +1 -0
  40. data/facts/2.4/windows-7-x64.facts +1 -0
  41. data/facts/2.5/archlinux-x86_64.facts +1 -0
  42. data/facts/2.5/sles-15-x86_64.facts +2 -0
  43. data/facts/2.5/solaris-10-i86pc.facts +4 -4
  44. data/facts/2.5/ubuntu-18.04-aarch64.facts +3 -2
  45. data/facts/3.0/ubuntu-15.10-i386.facts +6 -0
  46. data/facts/3.0/ubuntu-15.10-x86_64.facts +6 -0
  47. data/facts/3.10/archlinux-x86_64.facts +2 -1
  48. data/facts/3.10/ubuntu-18.04-aarch64.facts +9 -2
  49. data/facts/3.11/archlinux-x86_64.facts +3 -2
  50. data/facts/3.11/solaris-10-i86pc.facts +4 -4
  51. data/facts/3.12/archlinux-x86_64.facts +3 -2
  52. data/facts/3.13/ubuntu-16.04-x86_64.facts +218 -104
  53. data/facts/3.14/VirtuozzoLinux-7-x86_64.facts +4 -4
  54. data/facts/3.14/archlinux-x86_64.facts +2 -1
  55. data/facts/3.14/centos-9-x86_64.facts +478 -0
  56. data/facts/3.14/rocky-8-x86_64.facts +6 -6
  57. data/facts/3.14/ubuntu-16.04-x86_64.facts +94 -94
  58. data/facts/3.14/ubuntu-21.04-x86_64.facts +6 -6
  59. data/facts/3.2/aix-53-powerpc.facts +8 -2
  60. data/facts/3.2/aix-61-powerpc.facts +8 -2
  61. data/facts/3.2/aix-71-powerpc.facts +8 -2
  62. data/facts/3.6/amazon-2017-x86_64.facts +9 -9
  63. data/facts/3.6/pcs-6-x86_64.facts +8 -2
  64. data/facts/3.9/aix-7.1-power.facts +4 -4
  65. data/facts/3.9/archlinux-x86_64.facts +2 -1
  66. data/facts/3.9/solaris-10-i86pc.facts +4 -4
  67. data/facts/4.0/centos-7-x86_64.facts +3 -0
  68. data/facts/4.0/debian-10-x86_64.facts +3 -0
  69. data/facts/4.0/fedora-35-x86_64.facts +504 -0
  70. data/facts/4.0/oraclelinux-7-x86_64.facts +3 -0
  71. data/facts/4.0/redhat-7-x86_64.facts +3 -0
  72. data/facts/4.0/scientific-7-x86_64.facts +3 -0
  73. data/facts/4.0/solaris-11-sun4v.facts +3 -0
  74. data/facts/4.0/ubuntu-16.04-x86_64.facts +551 -0
  75. data/facts/4.1/fedora-35-x86_64.facts +506 -0
  76. data/facts/4.1/ubuntu-16.04-x86_64.facts +553 -0
  77. data/facts/4.2/centos-9-x86_64.facts +14 -3
  78. data/facts/4.2/fedora-35-x86_64.facts +506 -0
  79. data/facts/4.2/oraclelinux-9-x86_64.facts +14 -3
  80. data/facts/4.2/popos-21.10-x86_64.facts +551 -0
  81. data/facts/4.2/redhat-9-x86_64.facts +14 -3
  82. data/facts/4.2/ubuntu-16.04-x86_64.facts +559 -0
  83. data/facts/Vagrantfile +11 -62
  84. data/facts/get_facts.sh +9 -183
  85. data/lib/facterdb/version.rb +1 -1
  86. data/spec/facts_spec.rb +18 -42
  87. metadata +11 -3
data/facts/get_facts.sh CHANGED
@@ -30,23 +30,7 @@ elif test -f /usr/bin/apt-get; then
30
30
  osfamily='Debian'
31
31
  elif test -f /etc/redhat-release ; then
32
32
  operatingsystemmajrelease=$(rpm -qf /etc/redhat-release --queryformat '%{version}' | cut -f1 -d'.')
33
- case $(rpm -qf /etc/redhat-release --queryformat '%{name}') in
34
- almalinux*)
35
- osfamily='AlmaLinux'
36
- ;;
37
- centos*|redhat*)
38
- osfamily='RedHat'
39
- ;;
40
- fedora*)
41
- osfamily='Fedora'
42
- ;;
43
- rocky-*)
44
- osfamily='RockyLinux'
45
- ;;
46
- *)
47
- echo 'Failed to determine osfamily from /etc/redhat-release'
48
- exit 1
49
- esac
33
+ osfamily='RedHat'
50
34
  elif test -f '/usr/bin/pacman'; then
51
35
  operatingsystemmajrelease=3
52
36
  osfamily='Archlinux'
@@ -54,118 +38,22 @@ elif test -f '/etc/gentoo-release'; then
54
38
  osfamily='Gentoo'
55
39
  elif test -f '/etc/os-release' && grep -q 'Amazon' '/etc/os-release'; then
56
40
  osfamily='RedHat'
57
- operatingsystemmajrelease=$(rpm -qf /etc/os-release --queryformat '%{version}' | cut -f1 -d'.')
58
- if [[ $operatingsystemmajrelease -eq 2 ]]; then
59
- operatingsystemmajrelease='7'
60
- else
61
- operatingsystemmajrelease='6'
62
- fi
41
+ operatingsystemmajrelease='7'
63
42
  else
64
43
  osfamily=$(uname)
65
44
  fi
66
45
 
67
46
  case "${osfamily}" in
68
- 'Fedora')
69
-
70
- yum install -y "https://yum.puppetlabs.com/puppetlabs-release-pc1-fedora-${operatingsystemmajrelease}.noarch.rpm"
71
- # Puppet 4 doesn't support Fedora 28 anymore
72
- if [[ "${?}" == 0 ]]; then
73
- for puppet_agent_version in 1.5.3-1 1.6.0-1 1.6.1-1 1.6.2-1 1.7.0-1 1.10.12-1; do
74
- dnf install -y "puppet-agent-${puppet_agent_version}.fedoraf${operatingsystemmajrelease}"
75
- if [[ "${?}" == 0 ]]; then
76
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
77
- mkdir -p $(dirname ${output_file})
78
- facter --show-legacy -p -j | tee ${output_file}
79
- fi
80
- done
81
- yum remove -y puppetlabs-release-pc1
82
- fi
83
- # Puppet 5
84
- yum install -y "https://yum.puppetlabs.com/puppet5/puppet5-release-fedora-${operatingsystemmajrelease}.noarch.rpm"
85
- if [[ "${?}" == 0 ]]; then
86
- for puppet_agent_version in 5.3.1-1 5.3.2-1 5.3.3-1 5.3.4-1 5.3.5-1 5.4.0-1 5.5.16-1; do
87
- # Package naming changed with Fedora 28
88
- [[ ${operatingsystemmajrelease} -ge 28 ]] && osprefix='fc' || osprefix='fedoraf'
89
- echo dnf install -y "puppet-agent-${puppet_agent_version}.${osprefix}${operatingsystemmajrelease}"
90
- dnf install -y "puppet-agent-${puppet_agent_version}.${osprefix}${operatingsystemmajrelease}"
91
- if [[ "${?}" == 0 ]]; then
92
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
93
- echo "Outputfile: $output_file"
94
- mkdir -p $(dirname ${output_file})
95
- facter --show-legacy -p -j | tee ${output_file}
96
- fi
97
- done
98
- yum remove -y puppet5-release
99
- fi
100
- # Puppet 6
101
- yum install -y "https://yum.puppetlabs.com/puppet6-release-fedora-${operatingsystemmajrelease}.noarch.rpm"
102
- if [[ "${?}" == 0 ]]; then
103
- for puppet_agent_version in 6.25.0-1; do
104
- dnf install -y "puppet-agent-${puppet_agent_version}.fc${operatingsystemmajrelease}"
105
- if [[ "${?}" == 0 ]]; then
106
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
107
- mkdir -p $(dirname ${output_file})
108
- facter --show-legacy -p -j | tee ${output_file}
109
- fi
110
- done
111
- yum remove -y puppet6-release
112
- fi
113
- # Puppet 7
114
- if [[ $operatingsystemmajrelease == '33' ]] && command -v facter &> /dev/null; then
115
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
116
- mkdir -p $(dirname ${output_file})
117
- facter --show-legacy -p -j | tee ${output_file}
118
- fi
119
- yum install -y "https://yum.puppetlabs.com/puppet7-release-fedora-${operatingsystemmajrelease}.noarch.rpm"
120
- if [[ "${?}" == 0 ]]; then
121
- for puppet_agent_version in 7.12.0-1; do
122
- dnf install -y "puppet-agent-${puppet_agent_version}.fc${operatingsystemmajrelease}"
123
- if [[ "${?}" == 0 ]]; then
124
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
125
- mkdir -p $(dirname ${output_file})
126
- facter --show-legacy -p -j | tee ${output_file}
127
- fi
128
- done
129
- yum remove -y puppet6-release
130
- fi
131
- ;;
132
47
  'RedHat')
133
- if [[ ${operatingsystemmajrelease} -eq 5 ]]; then
134
- # CentOS 5 can no longer wget the release file with HTTPS due to mis-matched SSL support:
135
- http_method='http'
136
- # The default CentOS repositories no longer work and prevent yum from working:
137
- rm -f /etc/yum.repos.d/CentOS*
48
+ . /etc/os-release
49
+ if [[ $ID == fedora ]]; then
50
+ distcode=fedora
138
51
  else
139
- http_method='https'
140
- fi
141
- wget "${http_method}://yum.puppetlabs.com/puppetlabs-release-pc1-el-${operatingsystemmajrelease}.noarch.rpm" -O /tmp/puppetlabs-release-pc1.rpm
142
- if test -f /tmp/puppetlabs-release-pc1.rpm; then
143
- rpm -ivh /tmp/puppetlabs-release-pc1.rpm
144
- for puppet_agent_version in 1.2.2 1.4.2 1.5.3 1.10.4; do
145
- if yum install -y puppet-agent-${puppet_agent_version}; then
146
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
147
- mkdir -p $(dirname ${output_file})
148
- facter --show-legacy -p -j | tee ${output_file}
149
- fi
150
- done
151
- yum remove -y puppetlabs-release-pc1
152
- fi
153
- wget "http://yum.puppetlabs.com/puppet5/puppet5-release-el-${operatingsystemmajrelease}.noarch.rpm" -O /tmp/puppet5-release.rpm
154
- if test -f /tmp/puppet5-release.rpm; then
155
- rpm -ivh /tmp/puppet5-release.rpm
156
- for puppet_agent_version in 5.0.1 5.1.0 5.3.7 5.4.0 5.5.16; do
157
- if yum install -y puppet-agent-${puppet_agent_version}; then
158
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
159
- mkdir -p $(dirname ${output_file})
160
- facter --show-legacy -p -j | tee ${output_file}
161
- fi
162
- done
163
- yum remove -y puppet5-release
52
+ distcode=el
164
53
  fi
165
- wget "http://yum.puppetlabs.com/puppet6-release-el-${operatingsystemmajrelease}.noarch.rpm" -O /tmp/puppet6-release.rpm
166
- if test -f /tmp/puppet6-release.rpm; then
167
- rpm -ivh /tmp/puppet6-release.rpm
168
- for puppet_agent_version in 6.2.0 6.4.2 6.6.0; do
54
+ yum -y install "https://yum.puppetlabs.com/puppet6-release-${distcode}-${operatingsystemmajrelease}.noarch.rpm"
55
+ if [[ "${?}" == 0 ]]; then
56
+ for puppet_agent_version in 6.25.0; do
169
57
  if yum install -y puppet-agent-${puppet_agent_version}; then
170
58
  output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
171
59
  mkdir -p $(dirname ${output_file})
@@ -187,49 +75,8 @@ case "${osfamily}" in
187
75
  yum remove -y puppet7-release
188
76
  fi
189
77
  ;;
190
- 'RockyLinux'|'AlmaLinux')
191
- dnf localinstall -y "http://yum.puppetlabs.com/puppet6-release-el-${operatingsystemmajrelease}.noarch.rpm"
192
- if dnf install -y puppet-agent; then
193
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
194
- mkdir -p $(dirname ${output_file})
195
- facter --show-legacy -p -j | tee ${output_file}
196
- fi
197
- ;;
198
-
199
78
  'Debian')
200
- if [[ "serena" =~ ${lsbdistcodename} ]]; then
201
- lsbdistcodename='xenial'
202
- fi
203
- if [[ "tessa" =~ ${lsbdistcodename} ]]; then
204
- lsbdistcodename='bionic'
205
- fi
206
79
  apt_install curl
207
- curl "https://apt.puppetlabs.com/puppetlabs-release-pc1-${lsbdistcodename}.deb" -o /tmp/puppetlabs-release-pc1.deb
208
- if test "$?" -eq 0 -a -f /tmp/puppetlabs-release-pc1.deb; then
209
- dpkg --install /tmp/puppetlabs-release-pc1.deb
210
- apt-get update
211
- for puppet_agent_version in 1.2.2 1.4 1.5 1.7 1.8 1.10; do
212
- if apt_install puppet-agent=${puppet_agent_version}*; then
213
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
214
- mkdir -p $(dirname ${output_file})
215
- facter --show-legacy -p -j | tee ${output_file}
216
- fi
217
- done
218
- apt-get -y remove --purge puppetlabs-release-pc1
219
- fi
220
- curl "https://apt.puppetlabs.com/puppet5-release-${lsbdistcodename}.deb" -o /tmp/puppet5-release.deb
221
- if test "$?" -eq 0 -a -f /tmp/puppet5-release.deb; then
222
- dpkg --install /tmp/puppet5-release.deb
223
- apt-get update
224
- for puppet_agent_version in 5.0 5.1 5.3 5.4 5.5; do
225
- if apt_install puppet-agent=${puppet_agent_version}*; then
226
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
227
- mkdir -p $(dirname ${output_file})
228
- facter --show-legacy -p -j | tee ${output_file}
229
- fi
230
- done
231
- apt-get -y remove --purge puppet5-release
232
- fi
233
80
  curl "https://apt.puppetlabs.com/puppet6-release-${lsbdistcodename}.deb" -o /tmp/puppet6-release.deb
234
81
  if test "$?" -eq 0 -a -f /tmp/puppet6-release.deb; then
235
82
  dpkg --install /tmp/puppet6-release.deb
@@ -299,27 +146,6 @@ case "${osfamily}" in
299
146
  else
300
147
  http_method='https'
301
148
  fi
302
- if rpm -Uvh ${http_method}://yum.puppet.com/puppetlabs-release-pc1-sles-${operatingsystemmajrelease}.noarch.rpm; then
303
- zypper --gpg-auto-import-keys --non-interactive refresh
304
- for puppet_agent_version in 1.6.2 1.7.2 1.8.3 1.9.3 1.10.8; do
305
- if zypper --non-interactive install puppet-agent-${puppet_agent_version}; then
306
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
307
- mkdir -p $(dirname ${output_file})
308
- facter --show-legacy -p -j | tee ${output_file}
309
- fi
310
- done
311
- zypper --non-interactive remove puppetlabs-release-pc1
312
- fi
313
- if rpm -Uvh ${http_method}://yum.puppet.com/puppet5/puppet5-release-sles-${operatingsystemmajrelease}.noarch.rpm; then
314
- for puppet_agent_version in 5.0.1 5.1.0 5.2.0 5.3.2 5.4.0 5.5.16; do
315
- if zypper --gpg-auto-import-keys --non-interactive install puppet-agent-${puppet_agent_version}; then
316
- output_file="/vagrant/$(facter --version | cut -d. -f1,2)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
317
- mkdir -p $(dirname ${output_file})
318
- facter --show-legacy -p -j | tee ${output_file}
319
- fi
320
- done
321
- zypper --non-interactive remove puppet5-release
322
- fi
323
149
  if rpm -Uvh ${http_method}://yum.puppet.com/puppet6-release-sles-${operatingsystemmajrelease}.noarch.rpm; then
324
150
  for puppet_agent_version in 6.2.0 6.4.2 6.6.0; do
325
151
  if zypper --gpg-auto-import-keys --non-interactive install puppet-agent-${puppet_agent_version}; then
@@ -1,5 +1,5 @@
1
1
  module FacterDB
2
2
  module Version
3
- STRING = '1.12.1'
3
+ STRING = '1.14.0'
4
4
  end
5
5
  end
data/spec/facts_spec.rb CHANGED
@@ -62,39 +62,6 @@ describe 'Default Facts' do
62
62
  end
63
63
  end
64
64
 
65
- KNOWN_IPADDRESS_PENDING = {
66
- 'facts/1.6/fedora-19-i386.facts' => 'unable to regenerate facts',
67
- 'facts/1.6/fedora-19-x86_64.facts' => 'unable to regenerate facts',
68
- 'facts/2.1/archlinux-x86_64.facts' => 'no ifconfig package',
69
- 'facts/3.10/ubuntu-18.04-aarch64.facts' => 'unable to regenerate facts',
70
- 'facts/1.6/archlinux-x86_64.facts' => 'no ifconfig package',
71
- 'facts/2.4/archlinux-x86_64.facts' => 'no ifconfig package',
72
- 'facts/3.2/aix-61-powerpc.facts' => 'unable to regenerate facts',
73
- 'facts/3.2/aix-71-powerpc.facts' => 'unable to regenerate facts',
74
- 'facts/3.2/aix-53-powerpc.facts' => 'unable to regenerate facts',
75
- 'facts/2.3/archlinux-x86_64.facts' => 'no ifconfig package',
76
- 'facts/2.5/archlinux-x86_64.facts' => 'no ifconfig package',
77
- 'facts/1.7/archlinux-x86_64.facts' => 'no ifconfig package',
78
- 'facts/2.0/archlinux-x86_64.facts' => 'no ifconfig package',
79
- 'facts/2.2/archlinux-x86_64.facts' => 'no ifconfig package',
80
- 'facts/3.6/pcs-6-x86_64.facts' => 'unable to regenerate facts',
81
- 'facts/3.0/ubuntu-15.10-x86_64.facts' => 'no puppet-agent package',
82
- 'facts/3.0/ubuntu-15.10-i386.facts' => 'no puppet-agent package',
83
- }
84
-
85
- KNOWN_HOSTNAME_PENDING = {
86
- 'facts/3.10/ubuntu-18.04-aarch64.facts' => 'unable to regenerate facts',
87
- 'facts/3.2/aix-61-powerpc.facts' => 'unable to regenerate facts',
88
- 'facts/3.2/aix-71-powerpc.facts' => 'unable to regenerate facts',
89
- 'facts/3.2/aix-53-powerpc.facts' => 'unable to regenerate facts',
90
- 'facts/3.6/pcs-6-x86_64.facts' => 'unable to regenerate facts',
91
- 'facts/3.0/ubuntu-15.10-x86_64.facts' => 'no puppet-agent package',
92
- 'facts/3.0/ubuntu-15.10-i386.facts' => 'no puppet-agent package',
93
- 'facts/4.2/centos-9-x86_64.facts' => 'no legacy facts',
94
- 'facts/4.2/oraclelinux-9-x86_64.facts' => 'no legacy facts',
95
- 'facts/4.2/redhat-9-x86_64.facts' => 'no legacy facts',
96
- }
97
-
98
65
  project_dir = Pathname.new(__dir__).parent
99
66
  FacterDB.default_fact_files.each do |filepath|
100
67
  relative_path = Pathname.new(filepath).relative_path_from(project_dir).to_s
@@ -113,15 +80,17 @@ describe 'Default Facts' do
113
80
  expect(content['facterversion']).to have_facter_version(facter_dir_path, filepath)
114
81
  end
115
82
 
116
- it 'contains an ipaddress or networking.ip fact' do
117
- pending KNOWN_IPADDRESS_PENDING[relative_path] if KNOWN_IPADDRESS_PENDING.key?(relative_path)
118
- case content['facterversion']
119
- when /^[1-3]/
120
- expect(content['ipaddress']).to not_be_nil.and not_be_empty
121
- else
83
+ it 'contains newer networking facts hash' do
84
+ if Gem::Version.new(content['facterversion']) >= Gem::Version.new('3.0.0')
122
85
  expect(content['networking']['ip']).to not_be_nil.and not_be_empty
86
+ expect(content['networking']['hostname']).to eq('foo')
87
+ expect(content['networking']['domain']).to eq('example.com')
88
+ expect(content['networking']['fqdn']).to eq('foo.example.com')
123
89
  end
124
90
  end
91
+ it 'contains the legacy ipaddress fact' do
92
+ expect(content['ipaddress']).to not_be_nil.and not_be_empty
93
+ end
125
94
  it 'contains no facts from puppetlabs/stdlib' do
126
95
  expect(content['root_home']).to be_nil
127
96
  expect(content['service_provider']).to be_nil
@@ -136,9 +105,16 @@ describe 'Default Facts' do
136
105
  expect(content['systemd_version']).to be_nil
137
106
  expect(content['systemd_internal_services']).to be_nil
138
107
  end
139
- it 'contains a hostname fact' do
140
- pending KNOWN_HOSTNAME_PENDING[relative_path] if KNOWN_HOSTNAME_PENDING.key?(relative_path)
141
- expect(content['hostname']).to not_be_nil.and not_be_empty
108
+ it 'contains a legacy hostname, domain and fqdn fact' do
109
+ expect(content['hostname']).to eq('foo')
110
+ expect(content['fqdn']).to eq('foo.example.com')
111
+ expect(content['domain']).to eq('example.com')
112
+ end
113
+ it 'contains the legacy osfamily fact' do
114
+ expect(content['osfamily']).to_not be_nil
115
+ end
116
+ it 'contains the legacy operatingsystem fact' do
117
+ expect(content['operatingsystem']).to_not be_nil
142
118
  end
143
119
  end
144
120
  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.12.1
4
+ version: 1.14.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: 2021-11-25 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -1313,6 +1313,7 @@ files:
1313
1313
  - facts/3.14/centos-6-x86_64.facts
1314
1314
  - facts/3.14/centos-7-x86_64.facts
1315
1315
  - facts/3.14/centos-8-x86_64.facts
1316
+ - facts/3.14/centos-9-x86_64.facts
1316
1317
  - facts/3.14/darwin-16-x86_64.facts
1317
1318
  - facts/3.14/darwin-17-x86_64.facts
1318
1319
  - facts/3.14/darwin-18-x86_64.facts
@@ -1745,6 +1746,7 @@ files:
1745
1746
  - facts/4.0/fedora-32-x86_64.facts
1746
1747
  - facts/4.0/fedora-33-x86_64.facts
1747
1748
  - facts/4.0/fedora-34-x86_64.facts
1749
+ - facts/4.0/fedora-35-x86_64.facts
1748
1750
  - facts/4.0/freebsd-11-x86_64.facts
1749
1751
  - facts/4.0/freebsd-12-x86_64.facts
1750
1752
  - facts/4.0/freebsd-13-x86_64.facts
@@ -1754,6 +1756,7 @@ files:
1754
1756
  - facts/4.0/rocky-8-x86_64.facts
1755
1757
  - facts/4.0/scientific-7-x86_64.facts
1756
1758
  - facts/4.0/solaris-11-sun4v.facts
1759
+ - facts/4.0/ubuntu-16.04-x86_64.facts
1757
1760
  - facts/4.0/ubuntu-18.04-x86_64.facts
1758
1761
  - facts/4.0/ubuntu-20.04-x86_64.facts
1759
1762
  - facts/4.0/ubuntu-21.04-x86_64.facts
@@ -1763,11 +1766,13 @@ files:
1763
1766
  - facts/4.1/fedora-32-x86_64.facts
1764
1767
  - facts/4.1/fedora-33-x86_64.facts
1765
1768
  - facts/4.1/fedora-34-x86_64.facts
1769
+ - facts/4.1/fedora-35-x86_64.facts
1766
1770
  - facts/4.1/freebsd-11-x86_64.facts
1767
1771
  - facts/4.1/freebsd-12-x86_64.facts
1768
1772
  - facts/4.1/freebsd-13-x86_64.facts
1769
1773
  - facts/4.1/redhat-8-x86_64.facts
1770
1774
  - facts/4.1/rocky-8-x86_64.facts
1775
+ - facts/4.1/ubuntu-16.04-x86_64.facts
1771
1776
  - facts/4.1/ubuntu-18.04-x86_64.facts
1772
1777
  - facts/4.1/ubuntu-20.04-x86_64.facts
1773
1778
  - facts/4.1/ubuntu-21.04-x86_64.facts
@@ -1783,17 +1788,20 @@ files:
1783
1788
  - facts/4.2/fedora-32-x86_64.facts
1784
1789
  - facts/4.2/fedora-33-x86_64.facts
1785
1790
  - facts/4.2/fedora-34-x86_64.facts
1791
+ - facts/4.2/fedora-35-x86_64.facts
1786
1792
  - facts/4.2/freebsd-11-x86_64.facts
1787
1793
  - facts/4.2/freebsd-12-x86_64.facts
1788
1794
  - facts/4.2/freebsd-13-x86_64.facts
1789
1795
  - facts/4.2/oraclelinux-7-x86_64.facts
1790
1796
  - facts/4.2/oraclelinux-8-x86_64.facts
1791
1797
  - facts/4.2/oraclelinux-9-x86_64.facts
1798
+ - facts/4.2/popos-21.10-x86_64.facts
1792
1799
  - facts/4.2/redhat-7-x86_64.facts
1793
1800
  - facts/4.2/redhat-8-x86_64.facts
1794
1801
  - facts/4.2/redhat-9-x86_64.facts
1795
1802
  - facts/4.2/rocky-8-x86_64.facts
1796
1803
  - facts/4.2/scientific-7-x86_64.facts
1804
+ - facts/4.2/ubuntu-16.04-x86_64.facts
1797
1805
  - facts/4.2/ubuntu-18.04-x86_64.facts
1798
1806
  - facts/4.2/ubuntu-20.04-x86_64.facts
1799
1807
  - facts/4.2/ubuntu-21.04-x86_64.facts
@@ -1838,7 +1846,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
1838
1846
  requirements:
1839
1847
  - - ">="
1840
1848
  - !ruby/object:Gem::Version
1841
- version: '0'
1849
+ version: 2.5.0
1842
1850
  required_rubygems_version: !ruby/object:Gem::Requirement
1843
1851
  requirements:
1844
1852
  - - ">="