From 13761c933a55a0d24908c6a719ed99c0c7b6c40e Mon Sep 17 00:00:00 2001 From: Thomas H Jones II Date: Wed, 13 Mar 2024 11:50:25 -0400 Subject: [PATCH] Fix dependency-logic --- ash-linux/el8/STIGbyID/cat1/RHEL-08-010140.sls | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ash-linux/el8/STIGbyID/cat1/RHEL-08-010140.sls b/ash-linux/el8/STIGbyID/cat1/RHEL-08-010140.sls index 57fc64448..bc406b38c 100644 --- a/ash-linux/el8/STIGbyID/cat1/RHEL-08-010140.sls +++ b/ash-linux/el8/STIGbyID/cat1/RHEL-08-010140.sls @@ -50,15 +50,17 @@ user_cfg_exists-{{ stig_id }}: - name: '{{ grubPassFile }}' - makedirs: True - onlyif: - - [[ -d /sys/firmware/efi/ ]] - - [[ ! -e {{ grubPassFile }} ]] + - test -d /sys/firmware/efi/ + - unless: {{ grubPassFile }} user_cfg_content-{{ stig_id }}: cmd.run: - name: 'printf "GRUB2_PASSWORD={{ grubEncryptedPass }}" > {{ grubPassFile }}' - cwd: /root - - require: + - onchanges: - file: user_cfg_exists-{{ stig_id }} + - onchanges_in: + - regen_grubCfg-{{ stig_id }} grubuser_superDef-{{ grubUserFile }}-{{ stig_id }}: file.replace: @@ -76,7 +78,7 @@ regen_grubCfg-{{ stig_id }}: cmd.run: - name: '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg' - cwd: /root - - require: - - file: grubuser_superDef-{{ grubUserFile }}-{{ stig_id }} - - file: grubuser_userSub-{{ grubUserFile }}-{{ stig_id }} + - onchanges: + - file: grubuser_superDef-{{ grubUserFile }}-{{ stig_id }} + - file: grubuser_userSub-{{ grubUserFile }}-{{ stig_id }} {%- endif %}