23 lines
553 B
YAML
23 lines
553 B
YAML
---
|
|
- hosts: all
|
|
gather_facts: true
|
|
tasks:
|
|
- name: Check updates (Linux)
|
|
ansible.builtin.command:
|
|
argv:
|
|
- dnf
|
|
- -q
|
|
- check-update
|
|
register: result
|
|
changed_when: result.rc == 100
|
|
failed_when: result.rc not in [0, 100]
|
|
when: ansible_os_family == "RedHat"
|
|
|
|
- name: Check updates (OpenBSD)
|
|
ansible.builtin.command:
|
|
argv:
|
|
- syspatch
|
|
- -c
|
|
register: result
|
|
changed_when: result.stdout != ""
|
|
when: ansible_os_family == "OpenBSD"
|