redhat-cop / infra.leapp

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

Regressions impacting upgrade role #207

Closed swapdisk closed 3 months ago

swapdisk commented 3 months ago

I've hit some failures using the upgrade role from the main branch.

First one is happens in the "Check for inhibitors" task of the parse_leapp_report role:

TASK [infra.leapp.parse_leapp_report : Check for inhibitors] *******************
fatal: [golden7shrimp]: FAILED! => {"msg": "The conditional check 'item.key not in leapp_known_inhibitors' failed. The error was: error while evaluating conditional (item.key not in leapp_known_inhibitors): 'leapp_known_inhibitors' is undefined. 'leapp_known_inhibitors' is undefined\n\nThe error appears to be in '/home/bmader/.ansible/collections/ansible_collections/infra/leapp/roles/parse_leapp_report/tasks/main.yml': line 21, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Check for inhibitors\n  ^ here\n"}

The problem here is that the upgrade role doesn't define a default value for leapp_known_inhibitors and it's not even a documented variable required by the upgrade role. It looks like this was introduced with PR #192 and also went out with the 1.3.0 release.

I worked around it by setting leapp_known_inhibitors: [] in my playbook and then hit the next regression. Again running the upgrade role, it fails with the next conditional of the same task:

TASK [infra.leapp.parse_leapp_report : Check for inhibitors] *******************
fatal: [golden7shrimp]: FAILED! => {"msg": "The conditional check '(leapp_high_sev_as_inhibitors | bool and item.severity == 'high') or 'inhibitor' in item.flags' failed. The error was: error while evaluating conditional ((leapp_high_sev_as_inhibitors | bool and item.severity == 'high') or 'inhibitor' in item.flags): 'leapp_high_sev_as_inhibitors' is undefined. 'leapp_high_sev_as_inhibitors' is undefined\n\nThe error appears to be in '/home/bmader/.ansible/collections/ansible_collections/infra/leapp/roles/parse_leapp_report/tasks/main.yml': line 21, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Check for inhibitors\n  ^ here\n"}

This time it's the leapp_high_sev_as_inhibitors boolean. It has no default value in the upgrade role and is not a documented required variable. This one was introduced with PR #199 which has not yet been released.

One further problem uncovered is when I had these failed runs, it then hit a failure in the handler running the "Rename log file" task of the common role. For example:

RUNNING HANDLER [infra.leapp.common : Rename log file] *************************
fatal: [pretty8mouse]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'os_path' is undefined. 'os_path' is undefined\\n\\nThe error appears to be in '/runner/requirements_collections/ansible_collections/infra/leapp/roles/common/handlers/main.yml': line 23, column 3, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n\\n- name: Rename log file\\n  ^ here\\n"}

Setting os_path: $PATH in the roles/common/defaults/main.yml file fixed the issue.

I'll take a crack at fixing these and open a PR.

swapdisk commented 3 months ago

Fixed by #208.