On Thu, 9 Feb 2023, H wrote:
Is it possible to use ansible, puppet or the like to do this on an existing system?
It's possible but can be a lot of work if you're not familiar with the software.
A simpler option is to save all your configured files in a version control system (git, subverion, mercury for example). That keeps a history of all the customizations you made and also makes it easy to revert a change that causes problems. There are open source tools to help (etckeeper is one but there are others).