I am currently trying to work out a way to use modules like general.ini_file
or general.lineinfile
in order to address volatile settings such as file system drivers or paths to data locations. Such settings should certainly be managed by Ansible, but if in an existing system found to be different, I do not want them to automatically change due to the possibly catastrophic data loss that could cause.
Instead, I think the go to would be for the play to fail, and for an experienced system administrator to look at the concrete situation to decide how to handle it, assuming one isn't writing a play for a fleet of thousands that expects specific situations like this regularly where it might make sense to write complicated plays to fix such issues - but even then, something would have to trigger such plays, and before the change was actually carried out and the damage might already be done.
TL;DR: Looking for a way to make a play or task that checks if general.ini_file
or general.lineinfile
would cause a change and fail instead.