Skip to content

Commit

Permalink
Update - add update cache option
Browse files Browse the repository at this point in the history
  • Loading branch information
voidquark committed Jan 24, 2024
1 parent ca134ef commit dfcb573
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Only dnf must be available on the target machine.
| Variable Name | Example Usage | Required | Description
| ----------- | ----------- | ----------- | ----------- |
| `el_patching_exclude_packages` | <pre>el_patching_exclude_packages:<br>&emsp;- tar<br>&emsp;- zip</pre> | No | Exclude packages during patching.
| `el_patching_update_cache` | `true` | No | Force dnf to check if cache is out of date and re-download if needed.

## Dependencies

Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ el_patching_auto_reboot: false
# el_patching_exclude_packages:
# - tar
# - zip
# el_patching_update_cache: true
5 changes: 4 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ansible.builtin.dnf:
name: "*"
state: latest
update_cache: "{{ el_patching_update_cache | default(omit) }}"
exclude: "{{ el_patching_exclude_packages | default(omit) }}"
when: el_patching_method == "all"

Expand All @@ -18,6 +19,7 @@
name: "*"
security: true
state: latest
update_cache: "{{ el_patching_update_cache | default(omit) }}"
exclude: "{{ el_patching_exclude_packages | default(omit) }}"
when: el_patching_method == "security"

Expand All @@ -26,6 +28,7 @@
name: "*"
bugfix: true
state: latest
update_cache: "{{ el_patching_update_cache | default(omit) }}"
exclude: "{{ el_patching_exclude_packages | default(omit) }}"
when: el_patching_method == "bugfix"

Expand All @@ -43,4 +46,4 @@
- name: Reboot host
ansible.builtin.reboot:
reboot_timeout: "{{ el_patching_reboot_timeout }}"
when: el_patching_auto_reboot | bool and __el_patching_need_restart.rc == 1
when: el_patching_auto_reboot | bool and __el_patching_need_restart.rc == 1

0 comments on commit dfcb573

Please sign in to comment.