theforeman / foreman-infra

Puppet modules and scripts to manage Foreman project infrastructure
https://theforeman.github.io/foreman-infra
Apache License 2.0
23 stars 51 forks source link

upgrade foreman01 to EL9 #2052

Closed evgeni closed 4 months ago

evgeni commented 5 months ago

Will also require a Foreman update as the current release doesn't work on EL9.

evgeni commented 5 months ago

[root@virt01 ~]# lvcreate --size 20G --name foreman01_snap --snapshot /dev/mapper/cs_node01-virt_foreman01 Logical volume "foreman01_snap" created.

[root@foreman01 ~]# dnf copr enable @theforeman/leapp [root@foreman01 ~]# dnf install leapp leapp-upgrade-el8toel9 leapp-data-centos

[root@foreman01 ~]# vi /etc/leapp/files/leapp_upgrade_repositories.repo

[root@foreman01 ~]# leapp preupgrade Upgrade has been inhibited due to the following problems: 1. Cannot perform the VDO check of block devices 2. Newest installed kernel not in use 3. Firewalld Configuration AllowZoneDrifting Is Unsupported 4. Missing required answers in the answer file [root@foreman01 ~]# dnf install vdo [root@foreman01 ~]# vi /etc/firewalld/firewalld.conf [root@foreman01 ~]# reboot [root@foreman01 ~]# leapp preupgrade [root@foreman01 ~]# reboot in the first boot process, leapp_resume failed to call reindexdb (and foreman-installer as we don't use it) [root@foreman01 ~]# su - postgres [postgres@foreman01 ~]$ reindexdb -a reindexdb: reindexing database "foreman" reindexdb: reindexing database "postgres" reindexdb: reindexing database "template1" [root@foreman01 ~]# vi /etc/selinux/config [root@foreman01 ~]# vi /etc/dnf/dnf.conf [root@foreman01 ~]# dnf remove \*leapp\* [root@foreman01 ~]# dnf remove rubygem-webpack-rails-0.9.11-1.el8.noarch kernel-modules-4.18.0-552.1.1.el8.x86_64 kernel-modules-4.18.0-553.6.1.el8.x86_64 rubygem-record_tag_helper-1.0.1-4.el8.noarch kernel-core-4.18.0-552.1.1.el8.x86_64 kernel-4.18.0-552.1.1.el8.x86_64 kernel-core-4.18.0-553.6.1.el8.x86_64 rubygem-mini_portile2-2.5.1-1.el8.noarch rubygem-thread_safe-0.3.6-6.el8.noarch kernel-4.18.0-553.6.1.el8.x86_64 [root@foreman01 ~]# rm /boot/vmlinuz-*rescue* /boot/initramfs-*rescue* rm: remove regular file '/boot/vmlinuz-0-rescue-01aa56009943454d83c2a1dbee2e74eb'? y rm: remove regular file '/boot/initramfs-0-rescue-01aa56009943454d83c2a1dbee2e74eb.img'? y [root@foreman01 ~]# /usr/lib/kernel/install.d/51-dracut-rescue.install add "$(uname -r)" /boot "/boot/vmlinuz-$(uname -r)" ```
evgeni commented 4 months ago

and dropped the snapshot:

[root@virt01 ~]# lvremove cs_node01/foreman01_snap
Do you really want to remove active logical volume cs_node01/foreman01_snap? [y/n]: y
  Logical volume "foreman01_snap" successfully removed.