IT Automation Basics: From Scripts to Self-Healing Systems

IT automation has a natural progression, and skipping a stage reliably produces fragility. The stages are not about tooling sophistication; each one depends on a discipline the previous one established.
Stage 1: Scripts
Somebody writes a shell or Python script to do a task they do often. This is where everyone starts and there is nothing wrong with it.
It becomes a problem when scripts live on individual laptops, when nobody knows which version is current, and when the person who wrote the critical one leaves. Three habits prevent this: put every script in version control from day one, require a header comment stating purpose, author and usage, and make scripts take arguments rather than hardcoding environment details.
You are ready for the next stage when you have more than a handful of scripts and the question “has this already been run on that server” cannot be answered.
Stage 2: Configuration management
Instead of scripting the steps to reach a state, you declare the state and let a tool reconcile. The machine should have these packages, these files, these services running.
The key property is idempotence: running it twice produces the same result as running it once. This is what makes it safe to run continuously, which in turn means configuration drift gets corrected automatically rather than discovered during an incident.
The discipline this stage requires is that manual changes stop. A server someone edited by hand will be reverted on the next run, which is either the feature working correctly or an outage, depending on whether your team has accepted the model.
Stage 3: Infrastructure as code
The infrastructure itself — networks, instances, load balancers, databases, permissions — is declared in files, versioned, reviewed and applied by a tool.
The benefits are the ones you would expect from treating infrastructure as software: review before change, a history of what changed and why, the ability to stand up an identical environment, and disaster recovery that is a procedure rather than an archaeology project.
The new disciplines are state management, because the tool keeps a record of what it believes exists and that record must be shared and locked; and drift detection, because changes made in the provider console outside the code will diverge. Run a plan on a schedule and alert on unexpected differences.
The common mistake here is writing infrastructure code for one environment and then copying it. Parameterise from the start.
Stage 4: Automated remediation
The system detects a known failure condition and fixes it without a human: restart a hung service, clear a full log partition, replace an unhealthy instance, fail over a connection pool.
This stage requires everything before it. Without reliable detection you will remediate the wrong thing; without version-controlled configuration you cannot reason about what the remediation will do.
Three rules make it safe. Remediate only known, specific conditions — a precise alert with a precise fix, never a general “something is wrong” handler. Rate limit every action, so a service restarting in a loop stops after three attempts and escalates rather than masking a real failure indefinitely. And log loudly: automated remediation that works silently hides a degrading system until it fails completely.
The rate limit is the one people skip and the one that matters most. A remediation that keeps a broken system superficially alive is worse than a clean failure, because nobody investigates.
What applies at every stage
- Secrets never in code. A secrets manager from day one, even for the first script.
- Least privilege. Automation credentials scoped to exactly what the task needs. An automation account with administrator rights is the largest standing risk in most environments.
- Test environments. Anything that can change production should be runnable somewhere else first.
- Observable runs. Who or what triggered it, what it did, how long it took, what the result was.
- A documented manual path. For every automated procedure, a written way to do it by hand, tested occasionally.
Self-service as the real payoff
The most valuable IT automation is usually not the clever remediation. It is the boring self-service: a form that provisions a standard environment, resets an account, grants time-bound access, or restores a backup to a scratch instance.
These remove the ticket queue that consumes most of an operations team’s attention, and they are built from the same components as everything above. Access grants with automatic expiry in particular solve a security problem and a workload problem at once.
Where to start
If you have scripts on laptops, start with version control and a shared runner. If you have configuration management but manual infrastructure, do infrastructure as code next. Do not build automated remediation until your alerting is accurate enough that you trust it, because remediation amplifies whatever your detection gets wrong.
Related guides
- What a Workflow Is, What a Workflow System Does, and How to Map One Before Automating
- Why Simple Automations Break After Month Two
- Automation Software Categories Explained
Featured image: Markus Spiske (CC0 1.0), via Openverse



One comment