# SPDX-License-Identifier: MIT
---

- name: Reboot the managed host to apply crypto policies changes
  reboot:
  listen: __crypto_policies_handler_modified
  when:
    - crypto_policies_reboot_required | d(false)
    - crypto_policies_reboot_ok | d(false)

- name: Clear the crypto_policies_reboot_required flag
  set_fact:
    crypto_policies_reboot_required: false
  listen: __crypto_policies_handler_modified
  when:
    - crypto_policies_reboot_required | d(false)
    - crypto_policies_reboot_ok | d(false)
