|
18 | 18 | - name: Check if cockpit is new enough (at least 257) to support existing certificates |
19 | 19 | when: ansible_facts.packages['cockpit-ws'][0].version | int >= 257 |
20 | 20 | block: |
| 21 | + - name: Check if the managed node needs crypto-policies to be able to use PQC |
| 22 | + when: |
| 23 | + - __cockpit_is_rh_distro | bool |
| 24 | + - (ansible_facts["distribution"] == "RedHat" and ansible_facts["distribution_version"] is version("9.7", ">=") |
| 25 | + and ansible_facts["distribution_version"] is version("10", "<")) |
| 26 | + or (ansible_facts["distribution"] != "RedHat" and |
| 27 | + ansible_facts['distribution_major_version'] is version("9", "==")) |
| 28 | + block: |
| 29 | + # calling role with null will just return the current policy |
| 30 | + - name: Get current crypto policy |
| 31 | + include_role: |
| 32 | + name: fedora.linux_system_roles.crypto_policies |
| 33 | + vars: |
| 34 | + crypto_policies_policy: null |
| 35 | + |
| 36 | + - name: Set variables needed for support and cleanup |
| 37 | + set_fact: |
| 38 | + # We need to reset this after the test is done |
| 39 | + __crypto_policies_policy: "{{ crypto_policies_active | d('') }}" |
| 40 | + |
| 41 | + # https://issues.redhat.com/browse/RHEL-107877 |
| 42 | + # rhel 9.7 and later, or EL9 other than RHEL, needs crypto-policies to be able to use PQC |
| 43 | + - name: Ensure managed node is able to use PQC |
| 44 | + include_role: |
| 45 | + name: fedora.linux_system_roles.crypto_policies |
| 46 | + vars: |
| 47 | + crypto_policies_policy: DEFAULT:PQ |
| 48 | + |
21 | 49 | - name: Create test certificate key |
22 | 50 | command: openssl ecparam -name secp521r1 -genkey -out /etc/myserver.key |
23 | 51 | args: |
|
73 | 101 | - always |
74 | 102 | - tests::cleanup |
75 | 103 |
|
| 104 | + - name: Reset crypto policies |
| 105 | + include_role: |
| 106 | + name: fedora.linux_system_roles.crypto_policies |
| 107 | + vars: |
| 108 | + crypto_policies_policy: "{{ __crypto_policies_policy }}" |
| 109 | + when: __crypto_policies_policy | d("") | length > 0 |
| 110 | + |
76 | 111 | - name: Cleanup |
77 | 112 | include_tasks: tasks/cleanup.yml |
0 commit comments