CertGrid CertGrid
Hands-on Lab·CompTIA Linux+

Infrastructure as code, idempotence and drift

Domain 4 asks for the vocabulary of infrastructure as code, and the words are easy to define and hard to recognise. This guide writes one short playbook describing a desired state, runs it twice to show what idempotence looks like in a recap line, breaks the machine behind its back, finds the drift with a dry run that changes nothing, and corrects it.

Automation and Scripting Guide 28 of 28 Intermediate

One host, which is both the control node and the target - `connection: local`, so nothing leaves the machine. The package is installed and removed within the page.
Server NameIP AddressOSRolesCPURAMHDD
LPLUS-B01192.168.0.74AlmaLinux 10.2RPM-family host - dnf, firewalld, NetworkManager, SELinux2 Core4 GB50 GB

This guide includes

Use this when you need to know what these terms mean in practice rather than as definitions. This matters because a script and a playbook look similar and behave completely differently on the second run, and because the difference is the entire reason the tools exist.

Before you start

  1. The tool, and what agentless means

  2. A description of a desired state

  3. Running it once, and running it again

  4. Drift, and finding it without correcting it

  5. Correcting it

  6. Putting the machine back

Official sources