I’m trying to execute a command "yum install kernel-devel-“kernel version” on rhel machines. each server has different kernel version , which im trying to perform manually .
if “uname -r” returns “3.10.0-514.6.2.el7.x86_64”,
then i run “yum install kernel-devel-3.10.0-514.6.2.el7.x86_64”
can this be automated using chef?
i tried a recipe by using execute resource and added ruby code to pull the kernal version in the command, but fails
execute 'yum ’ do
command “yum install kernel-devel-<% uname -r %>”