Skip to content

Commit

Permalink
Merge pull request #437 from ciprianbadescu/MODULES-9846/fix-cached-c…
Browse files Browse the repository at this point in the history
…atalog-install

(MODULES-9846) fix install using cached catalog
  • Loading branch information
Gheorghe Popescu authored Sep 17, 2019
2 parents d8c70d4 + 2bea0fe commit 3aef2ff
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions manifests/install/windows.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@
-PuppetStartType '${_agent_startup_mode}' \
-InstallArgs '${_install_options}' \
${_move_dll_workaround}",
unless => "${::system32}\\WindowsPowerShell\\v1.0\\powershell.exe \
-ExecutionPolicy Bypass \
-NoProfile \
-NoLogo \
-NonInteractive \
-Command {\$CurrentVersion = [string](facter.bat -p aio_agent_version); \
if (\$CurrentVersion -eq '${puppet_agent::_expected_package_version}') { \
exit 0; \
} \
exit 1; }.Invoke()",
path => $::path,
require => [
Puppet_agent_upgrade_error['puppet_agent_upgrade_failure.log'],
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/puppet_agent_windows_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@
end
end

context 'package_version =>' do
describe '5.6.7' do
let(:params) { global_params.merge(
{:package_version => '5.6.7'})
}
it {
is_expected.to contain_exec('install_puppet.ps1').with_unless(/\-Command {\$CurrentVersion = \[string\]\(facter.bat \-p aio_agent_version\);/)
is_expected.to contain_exec('install_puppet.ps1').with_unless(/\-Command.*if \(\$CurrentVersion \-eq '5\.6\.7'\) { +exit 0; *} *exit 1; }\.Invoke\(\)/)
}
end
end
context 'install_options =>' do
describe 'OPTION1=value1 OPTION2=value2' do
let(:params) { global_params.merge(
Expand Down

0 comments on commit 3aef2ff

Please sign in to comment.