Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Do not 'fips-mode-setup' to enable FIPS on RHEL 10 #489

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions tests/tests_luks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,30 @@
tags:
- tests::lvm
tasks:
- name: Enable FIPS mode
- name: Enable FIPS mode (RHEL 10 and newer)
when:
- lookup("env", "SYSTEM_ROLES_TEST_FIPS") == "true"
- ansible_facts["os_family"] == "RedHat"
- ansible_facts["distribution_major_version"] | int > 9
block:
- name: Enable FIPS mode
changed_when: false
shell: |
set -euxo pipefail
kernel=$(grubby --default-kernel)
boot_uuid=$(blkid --output value --match-tag UUID "$(findmnt --first --noheadings -o SOURCE /boot)")
grubby --update-kernel=$kernel --args="fips=1 boot=UUID=$boot_uuid"

- name: Reboot
reboot:
test_command: grep 1 /proc/sys/crypto/fips_enabled

- name: Enable FIPS mode (RHEL 8 and 9)
when:
- lookup("env", "SYSTEM_ROLES_TEST_FIPS") == "true"
- ansible_facts["os_family"] == "RedHat"
- ansible_facts["distribution_major_version"] | int > 7
- ansible_facts["distribution_major_version"] | int < 10
block:
- name: Enable FIPS mode
command: fips-mode-setup --enable
Expand All @@ -26,7 +45,7 @@
reboot:
test_command: fips-mode-setup --check

- name: Enable FIPS mode
- name: Enable FIPS mode (RHEL 7)
when:
- lookup("env", "SYSTEM_ROLES_TEST_FIPS") == "true"
- ansible_facts["os_family"] == "RedHat"
Expand Down
Loading