From a15159d0726d509baa066698021d9470c97a8768 Mon Sep 17 00:00:00 2001 From: Aki Kanellis Date: Sun, 19 Nov 2023 19:57:31 +0000 Subject: [PATCH] Make disabling unused filesystems idempotent The `os_unused_filesystems` was lacking sorting, making the task not idempotent. This was especially apparent and random in Molecule tests when this collection was added as a dependency. Signed-off-by: Aki Kanellis --- roles/os_hardening/templates/etc/modprobe.d/modprobe.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/os_hardening/templates/etc/modprobe.d/modprobe.j2 b/roles/os_hardening/templates/etc/modprobe.d/modprobe.j2 index dd3ea090d..7530cef16 100644 --- a/roles/os_hardening/templates/etc/modprobe.d/modprobe.j2 +++ b/roles/os_hardening/templates/etc/modprobe.d/modprobe.j2 @@ -1,6 +1,6 @@ {{ ansible_managed | comment }} # Generated by Ansible role {{ ansible_role_name }} -{% for fs in os_unused_filesystems | difference(os_filesystem_whitelist) %} +{% for fs in os_unused_filesystems | difference(os_filesystem_whitelist) | sort %} install {{fs}} /bin/true {% endfor %}