Migrating Reports to the new format in Foreman 3.2+

Do we have any update on email notification in Foreman 3.2?

Just another heads up, the original post got updated,
currently due to capacity issues we stopped the new Host Reports plugin development:

Hi,
when will the new Foreman-plugin-host-reports version 1.0.3 available for yum-repositories ?
I installed Foreman 3.3, but the newer host-report-package was not released yet.

Looking in the top of the article there is the fixed code linked, but no rpm was release for CentOS 7 / 8.
Any news about that ?

The plugin was discontinued at this point, hard to tell if someone will find a capacity to finish it in foreseeable future.

@Marek_Hulan, problem is here that the issue that was solved with the “patch” (changing locally code), is not feasible for the users. Normally this should be solved via a new RPM-package.

every user who is trying to install foreman will run into the issue that he has to manually change the code.

I suggested this would be solved with foreman 3.3, so therefore migration is still not available ^^

@Ron_Lavi @lzap I’ve just seen the rollback notification about this now and have already upgraded to Foreman 3.4 before attempting the steps to rollback. I’m unable to uninstall using the foreman-installer command mentioned in the notification:

# foreman-installer --no-enable-foreman-plugin-host-reports --no-enable-foreman-proxy-plugin-reports
2022-12-05 11:30:58 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-12-05 11:31:03 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-12-05 11:31:03 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
ERROR: Unrecognised option '--no-enable-foreman-plugin-host-reports'

Is there a workaround for my particular situation?

The installer support has been dropped (as well as all packaging). That means the default is essentially --no-enable-foreman-plugin-host-reports without an option to enable it.

Note that this was poor phrasing. It really didn’t uninstall, it stopped managing the plugin. There never was an uninstall command and you should manually run yum/apt/dnf remove on it.

Thanks, @ekohl.

Are these the rpms that should be uninstalled?

rubygem-foreman_host_reports.noarch 1.0.2-3.fm3_3.el8
rubygem-smart_proxy_reports.noarch 1.0.0-1.fm3_3.el8

OK, I had to perform the instructions in a slightly different order on 3.4 (and console argument was missing from the foreman-rake command). foreman-installer failed if hostreports weren’t removed.

  1. Remove database tables:
foreman-rake db:migrate:down VERSION=20220113064436
foreman-rake db:migrate:down VERSION=20211011141813
foreman-rake db:migrate:down VERSION=20210616133601
foreman-rake db:migrate:down VERSION=20210112183526
  1. Uninstall the plugin:
dnf remove rubygem-foreman_host_reports.noarch rubygem-smart_proxy_reports.noarch
  1. Delete host report status and widget objects:
# foreman-rake console
> HostStatus::Status.where(type: "HostStatus::HostReportStatus").delete_all
> Widget.where("template LIKE 'host_reports%'").delete_all
> Host.unscoped.all.find_each { |h| h.refresh_statuses; h.refresh_global_status }
  1. Reset Ansible report back to the original endpoint:
# foreman-installer --foreman-proxy-plugin-ansible-report-type foreman
  1. Reboot.
1 Like

That looks correct to me for Foreman 3.4 on EL8. The Debian package names start with ruby- and use dashes. So ruby-foreman-host-reports and ruby-smart-proxy-reports. Users on older versions should also include --no-enable-foreman-plugin-host-reports --no-enable-foreman-proxy-plugin-reports to the installer command.