Chapter 2: Introducing Ansible

Why automate Linux administration

For years, Linux administration has meant logging in to servers and changing them by hand, working from a checklist or from memory. That works for one machine. It breaks down at ten, and it is hopeless at a thousand.

If SSH, sudo, services, or permissions are new to you, try the short Linux readiness check before starting system labs.

The trouble with doing it by hand

Most administration has traditionally happened through a terminal or a GUI, one server at a time. The procedure lives in a runbook, a wiki page, or someone's head. Three things go wrong with that approach:

Manual administration versus Infrastructure as Code: Hand-applied changes slowly drift apart. Changes made through code are reviewed once and applied identically everywhere.

Automation addresses all three. You describe the work once, and a tool performs it the same way on every system, every time. That frees you from repetitive tasks, lets you roll out changes faster, and gives you time for work that actually needs a human.

Infrastructure as Code

A good automation system lets you practise Infrastructure as Code (IaC): you describe the state your infrastructure should be in, using a machine-readable language, and the tool makes reality match the description.

Two properties make this powerful:

Text files go into version control (Git). Every change is recorded, reviewable and reversible. To roll back, check out the last known-good version and apply it again.

A good IaC language is readable by people, not only by machines. Anyone on the team can understand what a change does before it is applied.

This is also the foundation of DevOps practice: developers describe the environment their application needs in code, operators review that code, and the same automation applies it reliably in every environment.

Automation reduces human error, if you let it

Moving to IaC changes how you work. The rule is simple:

With every change flowing through code, you can add the safety nets software teams already use:

The end goal is that all changes to your infrastructure happen through automation. That is what makes the environment consistent, auditable and predictable.

Key terms

Gradual, unplanned differences between systems that should be identical.Describing the desired state of infrastructure in machine-readable, human-readable text files, and applying them with a tool.What the system should look like when automation has finished, rather than the steps to get there.

Takeaway

Explain why manual administration causes errors and configuration drift. Use the chapter lab to check this on a real host.