From 2dba2a295c0d610469c3a0f6c5141beb4565f112 Mon Sep 17 00:00:00 2001 From: Thodoris Sotiropoulos Date: Tue, 13 Aug 2019 19:29:36 +0300 Subject: [PATCH] Add missing dependency The `Exec[os_patching::exec::fact]` requires the `${cache_dir}/reboot_override` file. --- manifests/init.pp | 5 ++++- spec/classes/os_patching_spec.rb | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 160e711d..96bece23 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -292,7 +292,10 @@ user => $patch_data_owner, group => $patch_data_group, refreshonly => true, - require => File[$fact_cmd], + require => [ + File[$fact_cmd], + File["${cache_dir}/reboot_override"] + ], } } diff --git a/spec/classes/os_patching_spec.rb b/spec/classes/os_patching_spec.rb index 9c78bd26..e6e351c8 100644 --- a/spec/classes/os_patching_spec.rb +++ b/spec/classes/os_patching_spec.rb @@ -110,6 +110,9 @@ when 'Linux' it { is_expected.to contain_cron('Cache patching data').with_ensure('present') } it { is_expected.to contain_cron('Cache patching data at reboot').with_ensure('present') } + it { is_expected.to contain_exec('os_patching::exec::fact').that_requires( + 'File[' + cache_dir + '/reboot_override]' + )} end it { is_expected.to contain_exec('os_patching::exec::fact') } it { is_expected.to contain_exec('os_patching::exec::fact_upload') }