34 lines
1.5 KiB
YAML
34 lines
1.5 KiB
YAML
---
|
|
|
|
- name: Patching | Supported platform
|
|
ansible.builtin.assert:
|
|
that:
|
|
- ansible_facts.os_family in ['Windows', 'Debian', 'RedHat']
|
|
fail_msg: 'Supported patching families: Windows, Debian, RedHat. No legacy Python bootstrap is performed.'
|
|
quiet: true
|
|
- name: Patching | Validate options
|
|
ansible.builtin.assert:
|
|
that:
|
|
- (os_patching_reboot) is boolean or (os_patching_reboot | string | lower) in ['true', 'false']
|
|
- (os_patching_rescan_after_reboot) is boolean or (os_patching_rescan_after_reboot | string | lower) in ['true', 'false']
|
|
- os_patching_reboot_timeout | int > 0
|
|
- os_patching_reboot_delay_minutes | int >= 0
|
|
- os_patching_reboot_delay_minutes | int <= 1440
|
|
- os_patching_reboot_message is string
|
|
- os_patching_reboot_message | length > 0
|
|
- os_patching_reboot_message | length <= 512
|
|
- os_patching_windows_categories is sequence
|
|
- os_patching_windows_categories is not string
|
|
- os_patching_windows_categories | length > 0
|
|
fail_msg: Invalid patching settings. Reboot/rescan flags must be boolean, reboot delay must be 0-1440 minutes and the reboot message must be 1-512 characters.
|
|
quiet: true
|
|
- name: Patching | Windows
|
|
ansible.builtin.include_tasks: windows.yml
|
|
when: ansible_facts.os_family == 'Windows'
|
|
- name: Patching | Debian
|
|
ansible.builtin.include_tasks: linux_debian.yml
|
|
when: ansible_facts.os_family == 'Debian'
|
|
- name: Patching | RedHat
|
|
ansible.builtin.include_tasks: linux_redhat.yml
|
|
when: ansible_facts.os_family == 'RedHat'
|