2022-04-19 12:01:03 -05:00
|
|
|
- name: Check /var free percentage
|
2024-04-01 00:53:08 -05:00
|
|
|
command: /bin/bash -c "df -m /var | tail -n 1 | awk '{ print \$5; }' | sed 's/%//'"
|
2022-04-19 12:01:03 -05:00
|
|
|
become: no
|
|
|
|
register: df_output
|
|
|
|
|
|
|
|
- name: Verify /var space
|
2022-11-20 20:03:01 -06:00
|
|
|
assert:
|
|
|
|
that:
|
2024-04-01 00:53:08 -05:00
|
|
|
- 90 > df_output.stdout|int
|
2022-04-19 12:01:03 -05:00
|
|
|
fail_msg: "Not enough free space"
|
|
|
|
|
2023-02-20 16:50:10 -06:00
|
|
|
- name: Update Archlinux Keyring
|
|
|
|
when: ansible_os_family == "Archlinux"
|
|
|
|
become: yes
|
|
|
|
package:
|
|
|
|
name: archlinux-keyring
|
|
|
|
state: latest
|
|
|
|
update_cache: yes
|
|
|
|
|
2022-04-19 12:01:03 -05:00
|
|
|
- name: Patching all packages
|
|
|
|
ignore_errors: yes
|
2023-02-20 16:50:10 -06:00
|
|
|
become: yes
|
2022-04-19 12:01:03 -05:00
|
|
|
register: updates
|
|
|
|
package:
|
|
|
|
upgrade: yes
|
|
|
|
update_cache: yes
|
|
|
|
|
|
|
|
- name: Reboot
|
|
|
|
ignore_errors: yes
|
2023-02-20 16:50:10 -06:00
|
|
|
become: yes
|
2022-04-19 12:01:03 -05:00
|
|
|
when: '"linux" in updates.stdout or "kernel" in updates.stdout'
|
|
|
|
reboot:
|
|
|
|
reboot_timeout: 2
|