# SPDX-License-Identifier: MIT
---
- name: Ensure that running the role does not update packages
  hosts: all
  tasks:
    - name: Get package facts
      package_facts:
      no_log: true

    - name: Save current package facts
      set_fact:
        __crypto_policies_packages_before: "{{ ansible_facts.packages }}"
      no_log: true

    - name: Include role
      include_role:
        name: linux-system-roles.crypto_policies

    - name: Refresh package facts
      package_facts:
      no_log: true

    - name: Verify packages were not changed
      assert:
        that: ansible_facts.packages == __crypto_policies_packages_before
