35 lines
849 B
YAML
35 lines
849 B
YAML
- name: Check /var free percentage
|
|
command: /bin/bash -c "df -m /var | tail -n 1 | awk '{ print $5; }' | sed 's/%//' "
|
|
become: no
|
|
register: df_output
|
|
|
|
- name: Verify /var space
|
|
assert:
|
|
that:
|
|
- 90 > {{ df_output.stdout }}
|
|
fail_msg: "Not enough free space"
|
|
|
|
- name: Update Archlinux Keyring
|
|
when: ansible_os_family == "Archlinux"
|
|
become: yes
|
|
package:
|
|
name: archlinux-keyring
|
|
state: latest
|
|
update_cache: yes
|
|
|
|
- name: Patching all packages
|
|
ignore_errors: yes
|
|
become: yes
|
|
register: updates
|
|
package:
|
|
upgrade: yes
|
|
update_cache: yes
|
|
|
|
- name: Reboot
|
|
ignore_errors: yes
|
|
become: yes
|
|
when: '"linux" in updates.stdout or "kernel" in updates.stdout'
|
|
reboot:
|
|
reboot_timeout: 2
|
|
|