def upgrade_pkgs_on_host(host, os)
  case os
  when :debian
    on host, "apt-get update"
    on host, "DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::=\"--force-confnew\" --force-yes -fuy dist-upgrade"
  when :redhat
    on host, "yum clean all -y"
    on host, "yum upgrade -y"
  when :fedora
    on host, "yum clean all -y"
    on host, "yum upgrade -y"
  else
    raise ArgumentError, "Unsupported OS '#{os}'"
  end
end

step "Upgrade each host" do
  hosts.each do |host|
    upgrade_pkgs_on_host(host, test_config[:os_families][host.name])
  end
end

Upgrade distros to ensure all packages are the latest
Upgrade distros to ensure all packages are the latest

Without this we are seeing elements fall behind, such as the new SSL changes
to the EPEL mirror which are no longer compatible with the SSL setup on older
RHEL6/7 boxes.

Signed-off-by: Ken Barber <470bc578162732ac7f9d387d34c4af4ca6e1b6f7@bob.sh>
