Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding cacheable variable to parse_leapp_report #223

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roles/parse_leapp_report/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `parse_leapp_report` role is used by the `analysis` or `upgrade` roles to ch
|-------------------------|-----------------------|-----------------------------------------------------|
| result_filename | "/var/log/leapp/leapp-report.txt" | Path of the Leapp pre-upgrade report file. |
| result_filename_prefix | "/var/log/leapp/leapp-report | The path used and the prefix name setting for the Leapp report |
| result_filename_json | "{{ result_filename_prefix }}.json | JSON filename using the selected "result_filename_prefix" |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you deleted this line, can you put it back because it doesn't look like it should be deleted then it looks good

| result_fact_cacheable | "false" | Allow the parse leapp report to be included as a cacheable fact |

## Example playbook

Expand Down
2 changes: 2 additions & 0 deletions roles/parse_leapp_report/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# defaults file for parse_leapp_report
result_filename_prefix: /var/log/leapp/leapp-report
result_filename_json: "{{ result_filename_prefix }}.json"

result_fact_cacheable: false
...
2 changes: 2 additions & 0 deletions roles/parse_leapp_report/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check failure on line 1 in roles/parse_leapp_report/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

load-failure[runtimeerror]

Failed to load YAML file: roles/parse_leapp_report/tasks/main.yml

Check failure on line 1 in roles/parse_leapp_report/tasks/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint / Ansible Lint

load-failure[runtimeerror]

Failed to load YAML file: roles/parse_leapp_report/tasks/main.yml
- name: Default upgrade_inhibited to false
ansible.builtin.set_fact:
upgrade_inhibited: false
Expand All @@ -15,11 +15,13 @@

- name: Parse report results
ansible.builtin.set_fact:
cacheable: "{{ result_fact_cacheable }}"
leapp_report_txt: "{{ results_txt.content | b64decode | split('\n') }}"
leapp_report_json: "{{ results_json.content | b64decode | from_json }}"

- name: Check for inhibitors
ansible.builtin.set_fact:
cacheable: "{{ result_fact_cacheable }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to fix the spacing here as well

upgrade_inhibited: true
leapp_inhibitors: "{{ leapp_inhibitors | default([]) + [item] }}"
when:
Expand Down
Loading