I saw you were using ansible in your newer videos and since I also wanted to check out laurel for better readable audit logs I've decided to chip in and restructure the configure-logging role as I want to use it to deploy laurel for our Linux server endpoints.
I've included the following adjustments:
Use FQCN instead of the short module name (i.e. 'ansible.builtin.file' instead of 'file')
Use ansible blocks to set vars on multiple tasks instead of having to set the same var everytime
'include' module is deprecated, use 'include_tasks' or 'include_vars'
Set loop_var using loop_control instead of using 'item.' in looped tasks
Remove 'become_method: sudo' as it is the default value
Make use of default vars that can be overwritten and are applied everywhere (i.e. you can change the laurel user etc.)
Include an SELinux section in case the target is running in enforced mode
Use package and service facts to skip tasks if they are not applicable to the target (i.e. no ufw tasks if there's no ufw installed and no selinux tasks if no selinux is installed, or on targets were selinux is not set to enforcing)
Hey,
I saw you were using ansible in your newer videos and since I also wanted to check out laurel for better readable audit logs I've decided to chip in and restructure the configure-logging role as I want to use it to deploy laurel for our Linux server endpoints.
I've included the following adjustments: