Files
a13labs.infra/ansible/roles/cis_hardening/tasks/extras.yml
T

22 lines
465 B
YAML
Raw Normal View History

2024-09-24 15:19:51 +02:00
---
- name: Reboot if required
tags:
- reboot
- ubuntu
when: reboot_ubuntu
block:
- name: Stat /var/run/reboot-required
ansible.builtin.stat:
path: /var/run/reboot-required
register: stat_reboot_required
- name: Notify reboot handler
become: true
ansible.builtin.setup: ~
notify:
- Reboot node
when:
- ansible_distribution == "Ubuntu"
- stat_reboot_required.stat.exists
...