simp-rspec-puppet-facts 3.2.0 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -3
  3. data/facts/2.5/almalinux-8-x86_64.facts +1337 -0
  4. data/facts/2.5/almalinux-9-x86_64.facts +1309 -0
  5. data/facts/2.5/amazon-2-x86_64.facts +357 -336
  6. data/facts/2.5/centos-7-x86_64.facts +215 -148
  7. data/facts/2.5/centos-8-x86_64.facts +244 -240
  8. data/facts/2.5/centos-9-x86_64.facts +1290 -0
  9. data/facts/2.5/oraclelinux-7-x86_64.facts +231 -163
  10. data/facts/2.5/oraclelinux-8-x86_64.facts +180 -188
  11. data/facts/2.5/redhat-7.9-x86_64.facts +1202 -0
  12. data/facts/2.5/redhat-8-x86_64.facts +189 -196
  13. data/facts/2.5/redhat-9-x86_64.facts +1291 -0
  14. data/facts/2.5/rocky-8-x86_64.facts +425 -270
  15. data/facts/2.5/windows-2012_r2-x64.facts +470 -0
  16. data/facts/2.5/windows-2016-x64.facts +514 -0
  17. data/facts/2.5/windows-2019-x64.facts +514 -0
  18. data/facts/2.5/windows-2022-x64.facts +516 -0
  19. data/facts/4.2/almalinux-8-x86_64.facts +1366 -0
  20. data/facts/4.2/almalinux-9-x86_64.facts +1335 -0
  21. data/facts/4.2/amazon-2-x86_64.facts +1218 -0
  22. data/facts/4.2/centos-7-x86_64.facts +1267 -0
  23. data/facts/4.2/centos-8-x86_64.facts +1316 -0
  24. data/facts/4.2/centos-9-x86_64.facts +1308 -0
  25. data/facts/4.2/oraclelinux-7-x86_64.facts +1251 -0
  26. data/facts/4.2/oraclelinux-8-x86_64.facts +1307 -0
  27. data/facts/4.2/redhat-7-x86_64.facts +1220 -0
  28. data/facts/4.2/redhat-8-x86_64.facts +1300 -0
  29. data/facts/4.2/redhat-9-x86_64.facts +1312 -0
  30. data/facts/4.2/rocky-8-x86_64.facts +1507 -0
  31. data/facts/4.2/windows-2012_r2-x64.facts +473 -0
  32. data/facts/4.2/windows-2016-x64.facts +517 -0
  33. data/facts/4.2/windows-2019-x64.facts +517 -0
  34. data/facts/4.2/windows-2022-x64.facts +519 -0
  35. data/lib/simp/rspec-puppet-facts.rb +48 -24
  36. data/lib/simp/version.rb +1 -1
  37. data/spec/acceptance/nodesets/almalinux8.yml +23 -0
  38. data/spec/acceptance/nodesets/almalinux9.yml +23 -0
  39. data/spec/acceptance/nodesets/amzn2.yml +23 -0
  40. data/spec/acceptance/nodesets/centos8.yml +1 -1
  41. data/spec/acceptance/nodesets/centos9.yml +23 -0
  42. data/spec/acceptance/nodesets/rhel8.yml +2 -1
  43. data/spec/acceptance/nodesets/rhel9.yml +23 -0
  44. data/spec/acceptance/nodesets/rocky8.yml +1 -1
  45. data/spec/acceptance/nodesets/win_2012r2.yml +12 -2
  46. data/spec/acceptance/nodesets/win_2016.yml +12 -2
  47. data/spec/acceptance/nodesets/win_2019.yml +12 -1
  48. data/spec/acceptance/nodesets/win_2022.yml +38 -0
  49. data/spec/acceptance/suites/default/00_default_spec.rb +7 -3
  50. data/spec/acceptance/suites/default/nodesets +1 -1
  51. data/spec/fixtures/metadata.json +17 -13
  52. data/spec/simp_rspec_puppet_facts_spec.rb +12 -10
  53. data/spec/spec_helper_acceptance.rb +32 -1
  54. metadata +116 -55
@@ -0,0 +1,23 @@
1
+ <%
2
+ if ENV['BEAKER_HYPERVISOR']
3
+ hypervisor = ENV['BEAKER_HYPERVISOR']
4
+ else
5
+ hypervisor = 'vagrant'
6
+ end
7
+ -%>
8
+ HOSTS:
9
+ el8.beaker.test:
10
+ roles:
11
+ - linux
12
+ - default
13
+ platform: el-8-x86_64
14
+ box: almalinux/8
15
+ hypervisor: <%= hypervisor %>
16
+
17
+ CONFIG:
18
+ validate: false
19
+ log_level: verbose
20
+ type: aio
21
+ <% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
22
+ puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
23
+ <% end -%>
@@ -0,0 +1,23 @@
1
+ <%
2
+ if ENV['BEAKER_HYPERVISOR']
3
+ hypervisor = ENV['BEAKER_HYPERVISOR']
4
+ else
5
+ hypervisor = 'vagrant'
6
+ end
7
+ -%>
8
+ HOSTS:
9
+ el9.beaker.test:
10
+ roles:
11
+ - linux
12
+ - default
13
+ platform: el-9-x86_64
14
+ box: almalinux/9
15
+ hypervisor: <%= hypervisor %>
16
+
17
+ CONFIG:
18
+ validate: false
19
+ log_level: verbose
20
+ type: aio
21
+ <% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
22
+ puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
23
+ <% end -%>
@@ -0,0 +1,23 @@
1
+ <%
2
+ if ENV['BEAKER_HYPERVISOR']
3
+ hypervisor = ENV['BEAKER_HYPERVISOR']
4
+ else
5
+ hypervisor = 'vagrant'
6
+ end
7
+ -%>
8
+ HOSTS:
9
+ amzn2:
10
+ roles:
11
+ - default
12
+ platform: el-7-x86_64
13
+ box: gbailey/amzn2
14
+ hypervisor: <%= hypervisor %>
15
+
16
+ CONFIG:
17
+ log_level: verbose
18
+ synced_folder : disabled
19
+ type: aio
20
+ vagrant_memsize: 512
21
+ <% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
22
+ puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
23
+ <% end -%>
@@ -11,7 +11,7 @@ HOSTS:
11
11
  - linux
12
12
  - default
13
13
  platform: el-8-x86_64
14
- box: generic/centos8
14
+ box: centos/stream8
15
15
  hypervisor: <%= hypervisor %>
16
16
 
17
17
  CONFIG:
@@ -0,0 +1,23 @@
1
+ <%
2
+ if ENV['BEAKER_HYPERVISOR']
3
+ hypervisor = ENV['BEAKER_HYPERVISOR']
4
+ else
5
+ hypervisor = 'vagrant'
6
+ end
7
+ -%>
8
+ HOSTS:
9
+ el9.beaker.test:
10
+ roles:
11
+ - linux
12
+ - default
13
+ platform: el-9-x86_64
14
+ box: generic/centos9s
15
+ hypervisor: <%= hypervisor %>
16
+
17
+ CONFIG:
18
+ validate: false
19
+ log_level: verbose
20
+ type: aio
21
+ <% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
22
+ puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
23
+ <% end -%>
@@ -8,13 +8,14 @@
8
8
  HOSTS:
9
9
  rhel8:
10
10
  roles:
11
- - default
12
11
  - linux
12
+ - default
13
13
  platform: el-8-x86_64
14
14
  box: generic/rhel8
15
15
  hypervisor: <%= hypervisor %>
16
16
 
17
17
  CONFIG:
18
+ validate: false
18
19
  log_level: verbose
19
20
  type: aio
20
21
  <% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
@@ -0,0 +1,23 @@
1
+ <%
2
+ if ENV['BEAKER_HYPERVISOR']
3
+ hypervisor = ENV['BEAKER_HYPERVISOR']
4
+ else
5
+ hypervisor = 'vagrant'
6
+ end
7
+ -%>
8
+ HOSTS:
9
+ rhel9:
10
+ roles:
11
+ - linux
12
+ - default
13
+ platform: el-9-x86_64
14
+ box: generic/rhel9
15
+ hypervisor: <%= hypervisor %>
16
+
17
+ CONFIG:
18
+ validate: false
19
+ log_level: verbose
20
+ type: aio
21
+ <% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
22
+ puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
23
+ <% end -%>
@@ -11,7 +11,7 @@ HOSTS:
11
11
  - linux
12
12
  - default
13
13
  platform: el-8-x86_64
14
- box: CrunchyData/rocky8
14
+ box: rockylinux/8
15
15
  hypervisor: <%= hypervisor %>
16
16
  # NFS installation is broken
17
17
  synced_folder: disabled
@@ -10,7 +10,7 @@ HOSTS:
10
10
  roles:
11
11
  - windows
12
12
  platform: windows-server-amd64
13
- box: opentable/win-2012r2-standard-amd64-nocm
13
+ box: ferventcoder/win2012r2-x64-nocm
14
14
  hypervisor: <%= hypervisor %>
15
15
  vagrant_memsize: 2048
16
16
  vagrant_cpus: 2
@@ -21,7 +21,17 @@ HOSTS:
21
21
  CONFIG:
22
22
  log_level: verbose
23
23
  type: aio
24
- vagrant_memsize: 256
25
24
  <% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
26
25
  puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
27
26
  <% end -%>
27
+ ssh:
28
+ keepalive: true
29
+ keepalive_interval: 10
30
+ host_key:
31
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:host_key].join("\n#{' '*6}- ") %>
32
+ kex:
33
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:kex].join("\n#{' '*6}- ") %>
34
+ encryption:
35
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:encryption].join("\n#{' '*6}- ") %>
36
+ hmac:
37
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:hmac].join("\n#{' '*6}- ") %>
@@ -11,7 +11,7 @@ HOSTS:
11
11
  - windows
12
12
  platform: windows-server-amd64
13
13
  box: gusztavvargadr/windows-server
14
- box_version: 1607.0.1909
14
+ box_version: 1607.0.2201
15
15
  hypervisor: <%= hypervisor %>
16
16
  vagrant_memsize: 2048
17
17
  vagrant_cpus: 2
@@ -22,7 +22,17 @@ HOSTS:
22
22
  CONFIG:
23
23
  log_level: verbose
24
24
  type: aio
25
- vagrant_memsize: 256
26
25
  <% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
27
26
  puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
28
27
  <% end -%>
28
+ ssh:
29
+ keepalive: true
30
+ keepalive_interval: 10
31
+ host_key:
32
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:host_key].join("\n#{' '*6}- ") %>
33
+ kex:
34
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:kex].join("\n#{' '*6}- ") %>
35
+ encryption:
36
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:encryption].join("\n#{' '*6}- ") %>
37
+ hmac:
38
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:hmac].join("\n#{' '*6}- ") %>
@@ -11,6 +11,7 @@ HOSTS:
11
11
  - windows
12
12
  platform: windows-server-amd64
13
13
  box: gusztavvargadr/windows-server
14
+ box_version: 1809.0.2205
14
15
  hypervisor: <%= hypervisor %>
15
16
  vagrant_memsize: 2048
16
17
  vagrant_cpus: 2
@@ -21,7 +22,17 @@ HOSTS:
21
22
  CONFIG:
22
23
  log_level: verbose
23
24
  type: aio
24
- vagrant_memsize: 256
25
25
  <% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
26
26
  puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
27
27
  <% end -%>
28
+ ssh:
29
+ keepalive: true
30
+ keepalive_interval: 10
31
+ host_key:
32
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:host_key].join("\n#{' '*6}- ") %>
33
+ kex:
34
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:kex].join("\n#{' '*6}- ") %>
35
+ encryption:
36
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:encryption].join("\n#{' '*6}- ") %>
37
+ hmac:
38
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:hmac].join("\n#{' '*6}- ") %>
@@ -0,0 +1,38 @@
1
+ <%
2
+ if ENV['BEAKER_HYPERVISOR']
3
+ hypervisor = ENV['BEAKER_HYPERVISOR']
4
+ else
5
+ hypervisor = 'vagrant'
6
+ end
7
+ -%>
8
+ HOSTS:
9
+ win:
10
+ roles:
11
+ - windows
12
+ platform: windows-server-amd64
13
+ box: gusztavvargadr/windows-server
14
+ box_version: 2102.0.2205
15
+ hypervisor: <%= hypervisor %>
16
+ vagrant_memsize: 2048
17
+ vagrant_cpus: 2
18
+ user: vagrant
19
+ communicator: winrm
20
+ is_cygwin: false
21
+
22
+ CONFIG:
23
+ log_level: verbose
24
+ type: aio
25
+ <% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
26
+ puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
27
+ <% end -%>
28
+ ssh:
29
+ keepalive: true
30
+ keepalive_interval: 10
31
+ host_key:
32
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:host_key].join("\n#{' '*6}- ") %>
33
+ kex:
34
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:kex].join("\n#{' '*6}- ") %>
35
+ encryption:
36
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:encryption].join("\n#{' '*6}- ") %>
37
+ hmac:
38
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:hmac].join("\n#{' '*6}- ") %>
@@ -37,10 +37,14 @@ describe 'look out muppets' do
37
37
  end
38
38
 
39
39
  it 'should collect valid fact data' do
40
- # Stupid RSpec tricks
41
- output = on(host, 'puppet facts --render-as json').stdout
40
+ output = on(host, 'puppet facts --render-as json').stdout.lines.last
42
41
 
43
- expect{@output << JSON.parse(output)['values']}.to_not raise_error
42
+ expect do
43
+ parsed_output = JSON.parse(output)
44
+
45
+ # Something changed in the puppet facts output so handle both cases
46
+ @output.push(parsed_output['values'] || parsed_output)
47
+ end.to_not raise_error
44
48
  end
45
49
 
46
50
  # This should work regardless of OS
@@ -1 +1 @@
1
- spec/acceptance/suites/default/../../nodesets
1
+ ../../nodesets
@@ -15,27 +15,31 @@
15
15
  {
16
16
  "operatingsystem": "CentOS",
17
17
  "operatingsystemrelease": [
18
- "6",
19
- "7"
18
+ "7",
19
+ "8"
20
20
  ]
21
21
  },
22
22
  {
23
23
  "operatingsystem": "RedHat",
24
24
  "operatingsystemrelease": [
25
- "6",
26
- "7"
25
+ "7",
26
+ "8"
27
27
  ]
28
28
  }
29
29
  ],
30
30
  "puppet_version": [
31
- "2.7",
32
- "3.0",
33
- "3.1",
34
- "3.2",
35
- "3.3",
36
- "3.4",
37
- "3.5",
38
- "3.6",
39
- "3.7"
31
+ "5.5",
32
+ "6.0",
33
+ "6.4",
34
+ "6.5",
35
+ "6.6",
36
+ "6.16",
37
+ "6.18",
38
+ "6.22",
39
+ "7.0",
40
+ "7.0",
41
+ "7.4",
42
+ "7.5",
43
+ "7.6"
40
44
  ]
41
45
  }
@@ -24,22 +24,22 @@ describe 'Simp::RspecPuppetFacts' do
24
24
  expect(subject.size).to be >= 4
25
25
  end
26
26
  it 'should return supported OS' do
27
- expect(subject.keys.sort).to include 'centos-6-x86_64'
28
27
  expect(subject.keys.sort).to include 'centos-7-x86_64'
29
- expect(subject.keys.sort).to include 'redhat-6-x86_64'
28
+ expect(subject.keys.sort).to include 'centos-8-x86_64'
30
29
  expect(subject.keys.sort).to include 'redhat-7-x86_64'
30
+ expect(subject.keys.sort).to include 'redhat-8-x86_64'
31
31
  end
32
32
  it 'should return SIMP-specific OS facts' do
33
33
  grub_version_facts = subject.map{ |os,data| {os =>
34
34
  data.select{ |x,v| x == :uid_min || x == :grub_version }}}
35
35
  expect( grub_version_facts ).to include(
36
- {"centos-6-x86_64"=>{:uid_min=>"500", :grub_version=>"0.97"}}
36
+ {"centos-8-x86_64"=>{:uid_min=>"1000", :grub_version=>"2.03"}}
37
37
  )
38
38
  expect( grub_version_facts ).to include(
39
39
  {"centos-7-x86_64"=>{:uid_min=>"1000", :grub_version=>"2.02~beta2"}}
40
40
  )
41
41
  expect( grub_version_facts ).to include(
42
- {"redhat-6-x86_64"=>{:uid_min=>"500", :grub_version=>"0.97"}}
42
+ {"redhat-8-x86_64"=>{:uid_min=>"1000", :grub_version=>"2.03"}}
43
43
  )
44
44
  expect( grub_version_facts ).to include(
45
45
  {"redhat-7-x86_64"=>{:uid_min=>"1000", :grub_version=>"2.02~beta2"}}
@@ -81,7 +81,7 @@ describe 'Simp::RspecPuppetFacts' do
81
81
  context 'When specifying SIMP_FACTS_OS=redhat-6-x86_64,redhat-7-x86_64' do
82
82
  subject {
83
83
  x = ENV['SIMP_FACTS_OS']
84
- ENV['SIMP_FACTS_OS']='redhat-6-x86_64,redhat-7-x86_64'
84
+ ENV['SIMP_FACTS_OS']='centos,redhat-7-x86_64'
85
85
  h = on_supported_os()
86
86
  ENV['SIMP_FACTS_OS']=x
87
87
  h
@@ -89,12 +89,13 @@ describe 'Simp::RspecPuppetFacts' do
89
89
  it 'should return a hash' do
90
90
  expect(subject.class).to eq Hash
91
91
  end
92
- it 'should have 2 elements' do
93
- expect(subject.size).to eq 2
92
+ it 'should have 3 elements' do
93
+ expect(subject.size).to eq 3
94
94
  end
95
95
  it 'should return supported OS' do
96
96
  expect(subject.keys.sort).to eq [
97
- 'redhat-6-x86_64',
97
+ 'centos-7-x86_64',
98
+ 'centos-8-x86_64',
98
99
  'redhat-7-x86_64',
99
100
  ]
100
101
  end
@@ -117,8 +118,9 @@ describe 'Simp::RspecPuppetFacts' do
117
118
  )
118
119
  }
119
120
 
120
- it 'should output warning message' do
121
- expect { subject }.to output(/Can't find facts for 'debian-X-x86_64'/).to_stderr
121
+
122
+ it 'should output warning message', skip: "rspec issue: No longer able to catch message on stdout or stderr" do
123
+ expect { subject }.to output(%r(No facts were found in the FacterDB)).to_stdout
122
124
  end
123
125
  end
124
126
  end
@@ -4,7 +4,6 @@ require 'yaml'
4
4
  require 'simp/beaker_helpers'
5
5
  include Simp::BeakerHelpers
6
6
 
7
- require 'beaker/puppet_install_helper'
8
7
  require 'beaker-windows'
9
8
  include BeakerWindows::Path
10
9
  include BeakerWindows::Powershell
@@ -12,14 +11,46 @@ include BeakerWindows::Registry
12
11
  include BeakerWindows::WindowsFeature
13
12
 
14
13
  unless ENV['BEAKER_provision'] == 'no'
14
+ to_skip = []
15
+
16
+ facter_ng = ( ENV['BEAKER_facter_ng'] == 'yes' ? true : false )
17
+
15
18
  hosts.each do |host|
16
19
  # Install Puppet
17
20
  if host.is_pe?
18
21
  install_pe
22
+ elsif ENV['FACTER_GEM_VERSION']
23
+ begin
24
+ install_puppet_from_gem_on(
25
+ host,
26
+ version: ENV['PUPPET_VERSION'],
27
+ facter_version: ENV['FACTER_GEM_VERSION']
28
+ )
29
+
30
+ # Make scaffold dirs?
31
+ code_dir = on(host, 'puppet config print codedir').stdout.strip
32
+
33
+ host.mkdir_p("#{code_dir}/modules")
34
+ rescue => e
35
+ puts "#{host} does not support installing puppet from Gem...skipping"
36
+ puts e
37
+
38
+ to_skip << host
39
+
40
+ next
41
+ end
19
42
  else
20
43
  install_puppet
44
+
45
+ if facter_ng
46
+ on(host, 'puppet config set facterng true')
47
+ end
21
48
  end
22
49
  end
50
+
51
+ to_skip.each do |host|
52
+ hosts.delete(host)
53
+ end
23
54
  end
24
55
 
25
56
  hosts.each do |host|