| ▲ | Jolter 6 hours ago | |||||||||||||||||||||||||||||||
I like that idea! For an application like Terraform, Ansible or the like, it seems ideal. For something like in the article, I’m pretty sure a plan mode is overkill though. Planning mode must involve making a domain specific language or data structure of some sort, which the execution mode will interpret and execute. I’m sure it would add a lot of complexity to a reporting tool where data is only collected once per day. | ||||||||||||||||||||||||||||||||
| ▲ | d7w 2 hours ago | parent | next [-] | |||||||||||||||||||||||||||||||
It's not strictly related to the original theme, but I want to mention this. Ansible implementation is okay, but not perfect (plus, this is difficult to implement properly). For cases like file changes, it works, but if you install a package and rely on it later, the --check command will fail. So I am finding myself adding conditions like "is this a --check run?" Ansible is treated as an idempotent tool, which it's not. If I delete a package from the list, then it will pollute the system until I create a set of "tearing-down" jobs. Probably, Nix is a better alternative. | ||||||||||||||||||||||||||||||||
| ▲ | muvlon 5 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||
No need to overthink it. In any semi-modern language you can (de)serialize anything to and from JSON, so it's really not that hard. The only thing you need to do is have a representation for the plan in your program. Which I will argue is probably the least error-prone way to implement --dry-run anyway (as opposed to sprinkling branches everywhere). | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||