Skip to content

Commit

Permalink
Use new Leapp report schema 1.2.0 (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmcutter authored Aug 13, 2024
1 parent 567f40d commit 10e7ab0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 34 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/use_new_report_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
major_changes:
- Change Leapp report schema from default (1.0.0) to new 1.2.0 for analysis and upgrade.
...
10 changes: 1 addition & 9 deletions roles/analysis/tasks/analysis-leapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
ansible.builtin.shell: >
set -o pipefail;
export PATH={{ os_path }};
leapp preupgrade
leapp preupgrade --report-schema=1.2.0
{{ leapp_preupg_opts }}
{{ leapp_enable_repos_args }}
2>&1 | tee -a {{ log_file }}
Expand All @@ -93,12 +93,4 @@
ansible.builtin.include_role:
name: infra.leapp.parse_leapp_report

- name: analysis-leapp | Capture inhibitors in a list leapp_inhibitors
ansible.builtin.set_fact:
leapp_inhibitors: "{{ leapp_inhibitors | default([]) + [item] }}"
when:
- item.key not in leapp_known_inhibitors
- (leapp_high_sev_as_inhibitors | bool and item.severity == 'high') or
'inhibitor' in item.flags
loop: "{{ leapp_report_json.entries }}"
...
27 changes: 3 additions & 24 deletions roles/parse_leapp_report/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
- name: Check for inhibitors
ansible.builtin.set_fact:
upgrade_inhibited: true
leapp_inhibitors: "{{ leapp_inhibitors | default([]) + [item] }}"
when:
- item.key not in leapp_known_inhibitors | default([], true)
- (leapp_high_sev_as_inhibitors | default(false, true) | bool and item.severity == 'high') or
'inhibitor' in item.flags
'inhibitor' in item.groups | default([], true) or
'error' in item.groups | default([], true)
loop: "{{ leapp_report_json.entries }}"

- name: Collect inhibitors
Expand All @@ -43,27 +45,4 @@
changed_when: false
failed_when: false

- name: Block for handling leapp-report.txt errors
when: results_errors.stdout_lines | length > 0
block:
- name: Update upgrade_inhibited to true
ansible.builtin.set_fact:
upgrade_inhibited: true

- name: Construct a data structure to add high errors to leapp_report_json
ansible.builtin.set_fact:
__results_errors:
entries:
- audience: sysadmin
flags:
- inhibitor
severity: high
summary: "{{ results_errors.stdout }}"
title: "Likely issues found with high (error) severity found, see summary."
hostname: "{{ ansible_fqdn }}"

- name: Add errors as inhibitors to leapp_report_json
ansible.builtin.set_fact:
leapp_report_json: "{{ leapp_report_json | ansible.builtin.combine(__results_errors, list_merge='append') }}"

...
2 changes: 1 addition & 1 deletion roles/upgrade/tasks/leapp-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
ansible.builtin.shell: >
set -o pipefail;
export PATH={{ os_path }};
leapp upgrade
leapp upgrade --report-schema=1.2.0
{{ leapp_upgrade_opts }}
{{ leapp_enable_repos_args }}
2>&1 | tee -a {{ log_file }}
Expand Down

0 comments on commit 10e7ab0

Please sign in to comment.