Assume you have a third party program running on a server.
To configure it, you log in, apply some CLI commands and leave again.
Every time you do this, you also copy and paste the commands to some file in your git, so that in the future, you can figure out what was configured and you are also able to configure the server again if you ever need to.
This is prone to error.
I know that people invented things like Puppet to avoid this problem, but AFAIK Puppet relies on modules with which you can define state and then does idempotent operations. This means that you do not have a Puppet module for everything and that the modules you have might not be able to do all the configuration you want.
So after this long story:
Is there a proper way to "record" the commands you ran, so that you can run them and also document the run at the same time?
But doesn't that require that the vendor or at least the community provides a module for this program?- Not really. They all provide a method to run arbitrary commands. You only need to build your recipe, playbook, whatever they call it. You may even realize that some modules make tasks easier than piping 5 tools until you get a result.