Upgrading Foreman to a supported Rails version

For option 2 I’m taking a stab to see how hard it is. Writing down my steps.

I used GitHub - theforeman/foreman-installer-modulesync: Standard config files used across foreman-installer modules · GitHub to create a checkout for every module and then this simple script:

#!/usr/bin/env ruby

# frozen_string_literal: true

require 'json'

Dir['modules/*/puppet-*/metadata.json'].each do |path|
  metadata = JSON.parse(File.read(path))
  changed = false
  metadata['operatingsystem_support'].each do |os|
    if %w[RedHat CentOS AlmaLinux].include?(os['operatingsystem']) && !os['operatingsystemrelease'].include?('10')
      os['operatingsystemrelease'] << '10'
      changed = true
    end
  end

  File.write(path, "#{JSON.pretty_generate(metadata)}\n") if changed
end

For puppet-dns I also made a manual modification to enable EPEL 10 since that should include ISC DHCP (thanks Rebuilding our RPMs for el10 - #7 by bnerickson for the hint).

Then create the PRs using some shell:

for i in modules/theforeman/puppet-* ; do
  (
    cd $i && git checkout -b add-el10 && git commit -a -m 'Add EL 10 support' && git push --quiet $USER HEAD && hub pull-request --no-edit
  )
done

Now let’s see how unhappy CI is.

2 Likes