Catching up with current dev

This commit is contained in:
2022-04-19 12:01:03 -05:00
parent a881363b9b
commit d1140cf78b
15 changed files with 423 additions and 109 deletions

View File

@@ -7,44 +7,26 @@
# - target: the host grouper in the inventory -- default: all
#
# Patch then restart a node
- hosts: "{{ target | default('all') }}"
- hosts: Node0
order: sorted
ignore_unreachable: true
serial: 1
vars:
ansible_become: yes
ansible_become_user: root
ansible_become_method: sudo
vars_files:
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
tasks:
- 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: Patching all packages (ArchLinux)
ignore_errors: yes
when: ansible_os_family == "Archlinux"
pacman:
upgrade: yes
update_cache: yes
- name: Patching all packages (Debian)
ignore_errors: yes
when: ansible_os_family == "Debian"
apt:
upgrade: yes
update_cache: yes
- name: Reboot
ignore_errors: yes
reboot:
reboot_timeout: 2
roles:
- patching
- hosts: managed
order: sorted
ignore_unreachable: true
serial: 4
vars:
ansible_become: yes
ansible_become_method: sudo
vars_files:
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
roles:
- patching