5 ms·
I like the concept, but the problem with embedding random snippets of code into a document is there are too many assumptions about the state of the system they'
by peterwwillis 6y ago
I like the concept, but the problem with embedding random snippets of code into a document is there are too many assumptions about the state of the system they're running in. The operating system, the revision, the installed software, how it's configured, where things are located, orders of operation, what network you're on, what access your user has to what systems, etc.
Rather than embed snippets, write a single simple script that automates your steps, and create an immutable artifact. The simplest way to do this is to use Docker with a base image that mimics the target system, and performs all necessary steps in one go. This allows you to perform a 'test run' in an empty container to make sure the steps work. And you can embed in-line documentation and generate it with Doxygen or some other tool. (I highly recommend you get all your teams to standardize on a tool like this, and use it literally everywhere)
(Also, pet peeve, but what does DevOps have to do with this? Can we stop over-using this term please? Not everything that's "sysadminny" is DevOps)
- llarsson 6y agoYes, much better. This person should use Docker instead and output the RPM from the container. Reproducible as all assumptions are clearly stated and much faster to execute again if the source changes (using cached layers for most prerequisite steps). Keeps comments close to the actual code, too.
- theptip 6y ago> The simplest way to do this is to use Docker with a base image that mimics the target system, and performs all necessary steps in one go. Or better yet, run all your code in docker containers so you can run arbitrary slices of your production environment on your local machine. You’ll eventually hit some host-OS network issue where you need to inspect the machine that’s running your containers, but for artifacts/RPMs as described in this doc you should be able to do everything locally.