An (Automation-)Tool-independent script won't likely exist because those scripts are the main task of an automation tool. So those scripts are always tool-specific, if you want to take the advantage of using those tools.
If you do not use the specific features of your automation tool you'll effectively end up writing your own.
The normal way in Chef is to use the
file or
cookbookfile Resource, which simply just replaces files with fixed content or based templates, how you wish them to be and gives you possibilities to define, what is done when and if changes are made(e. g. restart special services). Pretty basic stuff. A good automation suites enables you to define your actions from a general default with use-case groups and deviations down to groups and single special cases.
Do you have an automation tool already in production? If that is so, I suggest to use it. Your automation tool should have been chosen to support all devices/servers you are running within your organization.
In general testing is badly needed for automation which only makes sense, if you have a lot of similar or identical setups. If not you have very much work with testing for every used platform.
So the first questions would be:
- Are automation tools already used?
- If yes, is that tool suited to your task(probably yes)?
- If not should you decide to integrate such a tool in your organization? (Quite a different sized task)