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

Add result_fact_cacheable var #231

Merged
merged 3 commits into from
Nov 14, 2024
Merged
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
3 changes: 3 additions & 0 deletions changelogs/fragments/add_cachable_variable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- Add optional parameter for allowing caching of facts within AAP
5 changes: 3 additions & 2 deletions roles/parse_leapp_report/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ The `parse_leapp_report` role is used by the `analysis` or `upgrade` roles to ch
| Name | Default value | Description |
|-------------------------|-----------------------|-----------------------------------------------------|
| 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" |
| 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" |
| result_fact_cacheable | false | Allow the results from parsing the LEAPP report be cacheable (primarily for AAP) |

## Example playbook

Expand Down
1 change: 1 addition & 0 deletions roles/parse_leapp_report/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# 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
Expand Up @@ -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 }}"
upgrade_inhibited: true
leapp_inhibitors: "{{ leapp_inhibitors | default([]) + [item] }}"
when:
Expand Down
Loading