I have a recipe that installs various base packages to my systems that are required for all systems across the enterprise.
In the recipe, I have the following block:
node['basepackages']['packages'].each do |curpackage| package curpackage end
This iterates through an array of packages set in the attributes file.
At this point, we are trying to bring in SuSE to the mix. The problem is, one of the base packages is sysstat and there is a conflict with an installed package (gettext-runtime) which needs to be removed before sysstat is installed.
How can I force the removal of the gettext-runtime package before it tries to install the array of packages?
Because of the way the packages are installed (see above) I can’t use methods such as “subscribes” or “notifies” and such. I also tried to enclose the above block inside of a ruby block to see if I could get it to run later in the process:
ruby_block “package_install” do
node[‘basepackages’][‘packages’].each do |curpackage|
This gave me an error about the “package” method.
How can I write this recipe so that it runs things in the correct order?