redhat-cop / infra.leapp

Collection of Ansible roles for automating RHEL in-place upgrades using Leapp.
MIT License
46 stars 37 forks source link

check_leapp_analysis_results not behaving as expected? #206

Closed swapdisk closed 1 month ago

swapdisk commented 2 months ago

When using upgrade role with check_leapp_analysis_results set to false, the play is failing here...

TASK [infra.leapp.parse_leapp_report : Collect human readable report results] ***
fatal: [pretty8mouse]: FAILED! => {"changed": false, "msg": "file not found: /var/log/leapp/leapp-report.txt"}
Tuesday 09 July 2024  16:16:17 +0000 (0:00:00.771)       0:00:05.870 ********** 

As I understand the expected behavior with check_leapp_analysis_results set to false, the role should continue to run the leapp upgrade even if the leapp-report.txt file is absent, i.e., even when an analysis job has not been run and/or a pre-upgrade report has not been generated.

Using latest infra.leapp 1.3.0 release.

I will fix this.

jeffmcutter commented 2 months ago

Hi @swapdisk,

My use case was to run analysis once and assert that no unknown inhibitors exist before going straight into remediate and upgrade without running analysis a second time.

We can add another when check_leapp_analysis_results at https://github.com/redhat-cop/infra.leapp/blob/main/roles/upgrade/tasks/leapp-upgrade.yml#L5 but the leapp RPM install also happens during analysis.

-Jeff

swapdisk commented 2 months ago

@jeffmcutter - right, I figured out the scenario you explained was the intended use case. To make this work so that an analysis job would not be needed first at all, the upgrade role would have to install the packages. Also, saving the ansible facts under the /etc/ansible/facts.d directory for validation after upgrade would need to be moved out of the analysis role and done early in the upgrade role. There are a couple more little things I discovered while trying to make this work. See work in progress at my dev branch here.

Reading this comment at #203, it seems like there is interest in making a single upgrade play work without doing analysis first. As long as we don't break anything with the existing "analysis first, then upgrade" behavior, I can see the value of having an upgrade run only option.

Thoughts?

djdanielsson commented 2 months ago

IMO analysis should be run first and that is what we should "support" and promote. if people want to make it work without running analysis that should be on them to make it work.

jeffmcutter commented 2 months ago

It would seem like they should be at least running analysis and checking for unknown inhibitors.

I sent a couple PR's that have justification beyond this use case. With them a user would be able to self install the packages and go straight into upgrade.

https://github.com/redhat-cop/infra.leapp/pull/210 https://github.com/redhat-cop/infra.leapp/pull/211

djdanielsson commented 1 month ago

I merged those PR's can we close this issue now?

swapdisk commented 1 month ago

Yes, I'll close it.