Why automate all the things? Why not?

Chef solutions architect Simon Fisher argues that the more you automate, the more efficient you can become - both in the IT department and elsewhere

When not writing articles for Computing magazine, I work as a solutions architect for Chef Software.

My role is to work with clients to demonstrate the benefits of infrastructure, application and compliance automation and then gain a deep understanding of their environment so that I can advise on the best approach for them to take in their automation journey.

It's a great role because although the end goal of making their customers happy is the same, no two clients are exactly the same.

One thing is for sure though - there is always scope for automation.

I'm a firm believer in the value of "automating all the things" and this spills over into my home life too. Over the past year I've been on a journey of home automation, starting off by installing a Nest learning thermostat, but quickly moving on to Wi-Fi lights, voice assistants and cameras that notify you on your smartphone when they detect a person (or next door's cat) on your property.

As with most IT environments, my home is now a heterogeneous mix of gadgets from different providers. However, through various services such as IFTTT (If This Then That) and hacking about on a Raspberry Pi, I've managed to get them all working together very nicely indeed.

As you can tell, I'm quite passionate about automation, and I'm going to share with you the benefits you'll reap when you start on this journey.

1) You get to go faster

All too often when working with clients I come across ‘IT management via Office', whereby the organisation has created a document or spreadsheet that describes in detail the steps needed to either build or make a change to their IT environment.

It is then the unenviable task of an engineer to follow these steps to the letter, potentially multiple times across many hundreds or thousands of servers.

The problem with this should be clear to see - it takes time.

The poor instruction-follower needs to first read the instruction, understand what it's doing, do it, and then verify that it's completed successfully before moving onto the next one. This is only made worse by the fact that deploying change to production invariably involves interacting with multiple machines all with different roles.

Automation tooling like Chef enables you to define your infrastructure and application deployments as code, which is executable repeatedly across all of your IT estate. This means that you no longer have to rely on manual interactions with systems and, crucially, can ship change to your customers faster.

After automating my home lighting, when I go to bed I'm able to open up a mobile app, tap one button and turn off all of the lights in the house without the manual effort of going around and flicking every switch. It seems trivial, but it is a real time saver.

2) You guarantee that things that should be the same, are the same

Another symptom of using documentation and manual processes for change to systems and applications is that it is very difficult to get 100 per cent consistency across environments.

Human nature makes it highly likely that when manually entering commands into a terminal window, those commands will be mis-keyed at some point. Scale that up to real production environments and you could end up with an estate where each node is configured differently, and this introduces the dreaded (and very difficult to debug) environment-level defect.

By defining a single version of the truth with automation tooling you then get the confidence that your changes will be consistently deployed every time you run them.

Now, when my wife comes home from work in the dark, cold winter months the downstairs lights are already on and the house temperature is set to 22 degrees all without her having to interact with any of these things manually.

[Next page: Getting to really understand how your systems work]

Why automate all the things? Why not?

Chef solutions architect Simon Fisher argues that the more you automate, the more efficient you can become - both in the IT department and elsewhere

3) You reduce the risk of change

Change is a scary thing - usually we limit change to occur in specified time windows (often at weekends) because we are concerned that change will break our production systems and applications. This is for a number of reasons that I've already alluded to already, namely:

Manual interactions mean that mistakes can happen; and,
Pre-production environments are generally configured differently to production

I have already stated how automation can help mitigate these two factors above. However, you can further reduce the risk of change by implementing a continuous-delivery pipeline.

For me, the main goal of a continuous delivery pipeline is to ensure that infrastructure and application changes are thoroughly and exhaustively tested in an automated manner before production so that the final step to ‘go live' is a trivial one. In an ideal pipeline the only manual interaction should be at the start to actually begin the change process, but in reality some manual approval gates will still be necessary so as to gain confidence in the automated process.

The key prerequisite for this is a solid set of automated tests that cover both your applications and the environment upon which they run. Organisations have been traditionally better at writing and running tests for their applications.

However, with test frameworks, such as Inspec from Chef, you can and should write tests for your infrastructure too. To level-up even further, try practising test-driven development where you write the tests for your infrastructure and applications before making any changes to them.

Initially your tests will fail, and then you will write just enough code to make all of your tests pass, keeping you very focused on the task in hand.

With regard to home automation, risk reduction for me comes from the peace of mind that my home is more secure. To this end, when the outdoor camera in the back garden detects any movement at night, or when the house is empty, a notification on my phone prompts me to check it out. Usually it's next door's cat prowling around.

However, it's great to have that piece of mind that tells me my home is secure.

4) You get to really understand how your systems work

The prerequisite for any automation journey, whether at home or in work, is knowledge of the things you are automating.

There is absolutely no value in automating something that you (or someone in your team) doesn't have knowledge about, because if problems come up when crafting your automation it is very hard to solve them. Intimate knowledge of your systems makes it easier to produce the right kind of automation, ensuring that the code that you produce does the right tasks for the job and nothing more.

When I installed my first home automation gadget (the Nest thermostat), I wasn't an expert in heating or electrical work. After reading the instructions (including the warning that it should be installed by a professional who knew what they were doing - which naturally I disregarded) it seemed to be a matter of connecting a couple of wires and that was it.

When I took the old thermostat off the wall, there were a lot more wires than I had anticipated (or were documented in the instruction manual) so I was confused.

Two days (with no heating) later, after a lot of reading and web searching, I was then equipped to connect the right wires to the right terminals and it all worked nicely. The lesson here: if it says use a professional, you should use a professional.

5) It's fun to do

If you look at the profiles of people in the IT industry, a high number of them will identify as ‘problem solvers' - we all enjoy identifying and fixing something.

Automation gives us this opportunity by allowing us to first recognise that manual processes are error prone and time consuming, we can come up with creative solutions that enable us to make changes faster without the worry of what will happen when we do it. A great sense of achievement can be felt the first time you click the button, and your infrastructure and applications are deployed on the fly with no manual intervention at all.

It's the same with home automation. All of these new gadgets attempt to solve a problem that we have lived with for many years; we usually don't know it's a problem until we've fixed it but then, paradoxically, can't live without the automation.

The great news is that it's an ongoing journey - for me there is always one more gadget that I can add to my automated home and at work the best automation is never ‘done' - it is continuously being improved.

Simon Fisher is solutions architect at Chef