diff --git a/manifests/osfamily/windows.pp b/manifests/osfamily/windows.pp index afc5cc704..26f9607c8 100644 --- a/manifests/osfamily/windows.pp +++ b/manifests/osfamily/windows.pp @@ -8,8 +8,10 @@ } elsif ($::puppet_agent::is_pe and (!$::puppet_agent::use_alternate_sources)) { $pe_server_version = pe_build_version() $tag = $::puppet_agent::arch ? { - 'x64' => 'windows-x86_64', - 'x86' => 'windows-i386', + 'x64' => $::fips_enabled ? { + true => 'windowsfips-x64', + default => 'windows-x86_64' }, + 'x86' => 'windows-i386' } if $::puppet_agent::alternate_pe_source { $source = "${::puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${tag}/${::puppet_agent::package_name}-${::puppet_agent::arch}.msi" diff --git a/spec/classes/puppet_agent_osfamily_windows_spec.rb b/spec/classes/puppet_agent_osfamily_windows_spec.rb index aca02cda4..8d70a519c 100644 --- a/spec/classes/puppet_agent_osfamily_windows_spec.rb +++ b/spec/classes/puppet_agent_osfamily_windows_spec.rb @@ -29,7 +29,7 @@ :clientcert => 'foo.example.vm', :puppet_confdir => "#{appdata}\\Puppetlabs\\puppet\\etc", :puppet_agent_appdata => appdata, - :env_temp_variable => 'C:/tmp', + :env_temp_variable => 'C:/tmp', :puppet_agent_pid => 42, :aio_agent_version => '1.0.0', }} @@ -58,7 +58,7 @@ :clientcert => 'foo.example.vm', :puppet_confdir => "#{appdata}\\Puppetlabs\\puppet\\etc", :puppet_agent_appdata => appdata, - :env_temp_variable => 'C:/tmp', + :env_temp_variable => 'C:/tmp', :puppet_agent_pid => 42, :aio_agent_version => '1.0.0', :serverversion => server_version @@ -74,4 +74,36 @@ end end + describe "supported Windows with fips mode enabled" do + server_version = '1.10.100' + let(:arch) { 'x64' } + let(:tag) { 'x64' } + let(:params) { { package_version: 'auto' } } + let(:appdata) { 'C:\ProgramData' } + let(:facts) do + { + :is_pe => true, + :osfamily => 'windows', + :operatingsystem => 'windows', + :architecture => arch, + :servername => 'master.example.vm', + :clientcert => 'foo.example.vm', + :puppet_confdir => "#{appdata}\\Puppetlabs\\puppet\\etc", + :puppet_agent_appdata => appdata, + :env_temp_variable => 'C:/tmp', + :puppet_agent_pid => 42, + :aio_agent_version => '1.0.0', + :serverversion => server_version, + :fips_enabled => true + } + end + + it { is_expected.to contain_file("#{appdata}\\Puppetlabs") } + it { is_expected.to contain_file("#{appdata}\\Puppetlabs\\packages") } + it do + is_expected.to contain_file("#{appdata}\\Puppetlabs\\packages\\puppet-agent-#{arch}.msi").with( + 'source' => "puppet:///pe_packages/#{pe_version}/windowsfips-#{tag}/puppet-agent-#{arch}.msi" + ) + end + end end diff --git a/spec/spec_helper_local.rb b/spec/spec_helper_local.rb index 53ac27bbd..d1c44fb77 100644 --- a/spec/spec_helper_local.rb +++ b/spec/spec_helper_local.rb @@ -20,6 +20,7 @@ :path => nil, :puppet_agent_appdata => nil, :system32 => nil, + :fips_enabled => false, :puppet_ssldir => '/dev/null/ssl', :puppet_config => '/dev/null/puppet.conf',