by ClumsyPilot · 4y ago · 0 comments
I feel most comments here miss the point of declerative systems - resillience.
You write a script to stand up an Application on a clean system, a declarative system does the same. But what if current state is not a blank slate? A declarative system is meant to be smart enough to achieve target state even if machine crahsed half way through the setup last time, or has a different config already running.
Writing a shell script that addresses all edgecases is hard. Now, declarative systems do fail, but that's the promice.
The nuance is subtle but important.
Let's say you stop tracking that file. In Chef, the file will simply remain in its last known state, because Chef forgot about it. Likewise, if you do the same process on other systems, files will be left in various states - causing configuration drift. This is what a declarative tool is meant to solve.
A proper declarative tool would _delete_ the file, because it's no longer tracked, to ensure that the system is in the state the user expects.