Closed Jason-Hendry closed 7 months ago
hi @Jason-Hendry
Thank you for the PR nice little tidy up. I was considering using the ansible facts for the GRUB_CMDLINE as a way to test also. I have noted that it has failed pre-commit for lint layout on yaml. If you could amended that am happy to merge this PR.
Many thanks again
uk-bolly
Checks if ipv6.disable is present in GRUB_CMDLINE_LINUX before appending it to prevent duplication
Overall Review of Changes: Adds a task to get the current value before appending Adds a second condition to only append it wasn't changed by the previous task and doesn't already exist in the file
Issue Fixes: 172
Enhancements: none
How has this been tested?: A physical server, running Ubuntu 22.04 minimal installation, was already provisioned then ran the playbook multiple times.
With existing different value![image](https://github.com/ansible-lockdown/UBUNTU22-CIS/assets/1018251/846b4967-33e0-4880-bf29-b7324c663931)
With no existing value![image](https://github.com/ansible-lockdown/UBUNTU22-CIS/assets/1018251/234e2822-3b1f-4500-baa8-a4edb4a17a0a)
When the current value matches the expected value![image](https://github.com/ansible-lockdown/UBUNTU22-CIS/assets/1018251/80f0ad40-e29b-434e-99eb-c13f911f48cd)