DevOps: I will never ever set up and maintain my environment by hand again!

Repeat after me:

I will never ever set up and maintain my environment by hand again!

I will never ever set up and maintain my environment by hand again!

I will never ever set up and maintain my environment by hand again!

If you ignore this advice, you might be ending like a lot of projects I’ve seen in the last years: Unmanageable, unstable, unpredictable and basically unreliable.

Use a tool

Ansible_logo.svgIf you ever happen to set up a something in your environment, learn about tools like Ansible and perhaps Terraform first. Provision your machines and VMs with these tools, roll out your environment using these tools and version the scripts in a repository.

Do not, ever, later on, do changes or install updates on your environment by hand! Again, use Ansible or a similar tool, to roll out and install updates and components.

Version things

220px-Git-logo.svgThe key to automatization is using tools like GIT extensively. Every single configuration file, every single automatization script needs to be put under version control. Every iteration, every change, needs to be versioned as well. Get rid of your local script repositories, keep things in a central, safe place. Share the scripts and configurations, and don’t only document them in your ticketing tool!

Do not use SSH

Of course, SSH is used when working with Ansible or other automatization tools. But you, or any of your team members, should not use it. Using SSH to do tasks on a machine is by definition a manual process, something which has to be avoided! So, forget about SSH as a tool for manually managing infrastructures, configurations, and machines. Script your changes, test your changes, roll out your changes or roll them back – all using Ansible (or other similar tools) and version those scripts as well.

Automatization is key, the tool is not

Don’t feel comfortable with Ansible? Not an issue, use Chef or Puppet or any other automatization framework instead! Don’t want to learn about Terraform? Then go the native route using AWS-CLI or Azure-CLI instead. GIT sucks? Use SVN or CVS or Mercurial!

Regardless of the tool: You need to get the right mindset, and you need to get it, before starting any work! It never worked (and never will work) bringing in automatization and tools later on. You simply won’t be able to consolidate all different configurations without any bigger effort. It’s not gonna work!

Be a developer

Yeah, I know. You are not a developer. You are an administrator. You don’t program things. You don’t write nasty code. You are the specialist, the surgeon.

Well, no. You are a fool if you happen to think so.

You need to think like a developer thinks: Laziness over repetition, scripts over manual approaches, versioning over file-share-based storage. A developer – and believe me, I am one these guys – has a very simple approach: Every repetition of any kind of functionality to be implemented, is basically a wast of time.

A developer tries to write specific code only once, he organizes code in libraries for reusability. He refuses to do things a second time if he could reuse existing code or a library.

Adopt this kind of thinking! Express everything in scripts. Version these scripts. Create your own library of scripts and share it with your fellow colleagues!

Stay in control

I get often asked: What and when do I need to automatize? The answer is simple: Everything, anytime. The moment you SSH into a machine and do any kind of change there, you have lost control. Even if you are unsure about a configurational change being the proper solution to an issue, use a script.

Did I say „Even“? Especially then!

Using an automatization framework, you can roll back the change or set up an environment into a well-known state, allowing you to safely perform changes, test the outcomes and understand the consequences. Since you have versioned everything, you can always revert back to the last known version. Since you have everything in a shared, safe place, you can even lose your computer and your notes – and still remain operational.

And, in case it was not clear enough: This holds true for any kind of environment – Bare-Metal, virtualized, cloud, everything in between.

To stay in control, automatize and version. Everything!

And now repeat the headline. Until you live it.