Skip to content

Commit

Permalink
(SIMP-MAINT) Add Windows 2016 and 2019 nodesets
Browse files Browse the repository at this point in the history
* Also added a missing requirement to the Gemfile
* Requires the following PRs to function:
  * voxpupuli/beaker-vagrant#26
  * puppetlabs/beaker-puppet#129
  • Loading branch information
trevor-vaughan committed Jan 19, 2020
1 parent 9d4d17c commit 59655fb
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 41 deletions.
1 change: 1 addition & 0 deletions lib/simp/rake/beaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'rake/tasklib'
require 'fileutils'
require 'puppetlabs_spec_helper/tasks/beaker'
require 'puppetlabs_spec_helper/tasks/fixtures'

module Simp; end
module Simp::Rake
Expand Down
73 changes: 41 additions & 32 deletions spec/acceptance/suites/windows/00_default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,46 @@

unless ENV['BEAKER_provision'] == 'no'
hosts.each do |host|
# Install Puppet
if host.is_pe?
install_pe
else
install_puppet
unless Simp::BeakerHelpers::Snapshot.exist?(host, 'puppet_installed')
# Install Puppet
if host.is_pe?
install_pe
else
install_puppet
end
end
end
end

hosts.each do |host|
# https://petersouter.co.uk/testing-windows-puppet-with-beaker/
case host['platform']
when /windows/
GEOTRUST_GLOBAL_CA = <<-EOM.freeze
-----BEGIN CERTIFICATE-----
MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT
MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG
EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg
R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9
9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq
fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv
iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU
1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+
bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW
MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA
ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l
uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn
Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS
tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF
PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un
hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV
5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==
-----END CERTIFICATE-----
EOM
install_cert_on_windows(host, 'geotrustglobal', GEOTRUST_GLOBAL_CA)
unless Simp::BeakerHelpers::Snapshot.exist?(host, 'puppet_installed')
# https://petersouter.co.uk/testing-windows-puppet-with-beaker/
case host['platform']
when /windows/
GEOTRUST_GLOBAL_CA = <<-EOM.freeze
-----BEGIN CERTIFICATE-----
MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBA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XtNHjUStedejV0NxPNO3CBWaAocvmMw==
-----END CERTIFICATE-----
EOM
install_cert_on_windows(host, 'geotrustglobal', GEOTRUST_GLOBAL_CA)
end
end
end

Expand Down Expand Up @@ -91,8 +95,13 @@
end
end


hosts.each do |host|
if Simp::BeakerHelpers::Snapshot.exist?(host, 'puppet_installed')
Simp::BeakerHelpers::Snapshot.restore(host, 'puppet_installed')
else
Simp::BeakerHelpers::Snapshot.save(host, 'puppet_installed')
end

describe 'windows hosts coexising with linux hosts' do
context "on #{host}" do
it 'should have puppet installed' do
Expand Down
12 changes: 3 additions & 9 deletions spec/acceptance/suites/windows/nodesets/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ HOSTS:
win:
roles:
- windows
- ad
platform: windows-server-amd64
box: opentable/win-2012r2-standard-amd64-nocm # VBOX ONLY
hypervisor: <%= hypervisor %>
Expand All @@ -18,19 +17,14 @@ HOSTS:
user: vagrant
communicator: winrm
is_cygwin: false
centos7:

el7:
roles:
- default
- client
platform: el-7-x86_64
box: centos/7
hypervisor: <%= hypervisor %>
centos6:
roles:
- client
platform: el-6-x86_64
box: centos/6
hypervisor: <%= hypervisor %>

CONFIG:
log_level: verbose
type: aio
Expand Down
35 changes: 35 additions & 0 deletions spec/acceptance/suites/windows/nodesets/win2016.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<%
if ENV['BEAKER_HYPERVISOR']
hypervisor = ENV['BEAKER_HYPERVISOR']
else
hypervisor = 'vagrant'
end
-%>
HOSTS:
win:
roles:
- windows
platform: windows-server-amd64
box: gusztavvargadr/windows-server
box_version: 1607.0.1909
hypervisor: <%= hypervisor %>
vagrant_memsize: 2048
vagrant_cpus: 2
user: vagrant
communicator: winrm
is_cygwin: false

el7:
roles:
- default
platform: el-7-x86_64
box: centos/7
hypervisor: <%= hypervisor %>

CONFIG:
log_level: verbose
type: aio
vagrant_memsize: 256
<% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
<% end -%>
34 changes: 34 additions & 0 deletions spec/acceptance/suites/windows/nodesets/win2019.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<%
if ENV['BEAKER_HYPERVISOR']
hypervisor = ENV['BEAKER_HYPERVISOR']
else
hypervisor = 'vagrant'
end
-%>
HOSTS:
win:
roles:
- windows
platform: windows-server-amd64
box: gusztavvargadr/windows-server
hypervisor: <%= hypervisor %>
vagrant_memsize: 2048
vagrant_cpus: 2
user: vagrant
communicator: winrm
is_cygwin: false

el7:
roles:
- default
platform: el-7-x86_64
box: centos/7
hypervisor: <%= hypervisor %>

CONFIG:
log_level: verbose
type: aio
vagrant_memsize: 256
<% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
<% end -%>

0 comments on commit 59655fb

Please sign in to comment.