Can we automate file recovery using puppet

Trying to achieve a task for file creation and deletion. Want to create a new file when a Linux machine installs and retain the deleted file

Hi @nitheshkannan

Firstly I don’t know puppet, so cannot tell you exactly how to achieve your goal. However, puppet is one of several tools that perform “desired state configuration”, meaning that you can nail your box to have a specific configuration and not permit it to be changed.

In terms of creating files when a system is provisioned, yes it can do that.

In terms of protecting files from being deleted, yes again - but not instantaneously. Any files that are under the control of puppet will be restored if they have been deleted or changed each time puppet checks the system. Note that it cannot track all files on the system. You would normally use it to manage configuration files in the /etc directory structure, and other well known locations of config files for various services.

1 Like

Thanks @Alistair_KodeKloud will try and see if it can be done