--- # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 - name: Check if reboot is required (RHEL) shell: needs-restarting -r register: reboot_output ignore_errors: true - name: Reboot host (RHEL) reboot: msg: "Reboot initiated by Ansible" connect_timeout: 5 reboot_timeout: 600 pre_reboot_delay: 0 post_reboot_delay: 30 test_command: whoami when: ('Reboot should not be necessary' not in reboot_output.stdout)