diff --git a/cookbooks/basics/recipes/default.rb b/cookbooks/basics/recipes/default.rb index de735ba..649b4e3 100644 --- a/cookbooks/basics/recipes/default.rb +++ b/cookbooks/basics/recipes/default.rb @@ -74,9 +74,22 @@ if node['platform'] == 'centos' template '/etc/yum.repos.d/softwarepublico.repo' do owner 'root' mode 0644 + notifies :run, "execute[yum_clean_cache]", :immediately + notifies :create, "ruby_block[yum-cache-reload]", :immediately + end + execute 'yum_clean_cache' do + command 'yum clean all' + action :nothing + end + # reload internal Chef yum cache + ruby_block "yum-cache-reload" do + block { Chef::Provider::Package::Yum::YumCache.instance.reload } + action :nothing end end + + # reload node[:fqdn] to make sure it reflects the contents of /etc/hosts # without that the variable :fqdn would not be available on first run ruby_block 'fqdn:update' do -- libgit2 0.21.2