1

we have an use case where we need to reboot a linux machine only if the new kernel version is installed/upgraded through yum_package. currently I am using chef-solo for running this.

ruby_block 'kernel-update-done' do
  action :nothing
  block do
    Chef::Application.fatal!('Kernel was updated. Please reboot and start chef again.')
  end
end

yum_package node[:linux][:packages][:kernel] do
  action [:install, :upgrade]
  notifies :upgrade, 'ruby_block[kernel-update-done]', :immediately
end

while reading through some blogs, I came to know that the best way to handle these conditions is to write custom LWRP.I am new in writing LWRP and would like to know how to proceed with this.

fukawi2
  • 5,396
  • 3
  • 32
  • 51

0 Answers0