MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Configuration Management in DevOps: Workflow, Tool Comparison, and an Ansible Example

Originally published on 2010-03-21; fully revised and updated.

Configuration management is the practice of defining and enforcing system configuration as code so environments stay consistent over time. This rewrite is aimed at DevOps engineers and platform teams who need repeatable deployments, reduced drift, and safer change control across development, staging, and production.

The original post was a short SlideShare embed. This updated version provides a complete, practical reference you can use directly.

Original embedded slide deck (archival)

Original permalink: https://www.devopsschool.com/blog/power-point-ppt-configuration-management/

{slideshare}[slideshare id=1117749&doc=configurationmanagement-090308134227-phpapp02]{/slideshare}

What configuration management solves

Without configuration management, servers and clusters tend to diverge over time: package versions drift, manual fixes are forgotten, and incidents become harder to reproduce. With configuration managed as code, teams can track changes, review them, and apply them consistently.

  • Consistency: same desired state across environments.
  • Auditability: configuration changes are tracked in version control.
  • Repeatability: rebuilding or scaling infrastructure is predictable.
  • Drift control: unauthorized or accidental changes are easier to detect and correct.
  • Safer operations: dry runs, peer review, and staged rollout reduce change risk.

End-to-end workflow in a DevOps pipeline

A robust workflow treats configuration exactly like application code: author, review, validate, stage, deploy, and continuously check for drift.

flowchart TD
    A[Define desired state as code] --> B[Commit to Git]
    B --> C[CI validates syntax and policy]
    C --> D[Review and approve]
    D --> E[Apply in staging]
    E --> F[Run service checks]
    F --> G{Promote to production}
    G -- no --> A
    G -- yes --> H[Apply in production]
    H --> I[Detect drift and open fix change]
    I --> A

Approaches and tools compared

Different tools can achieve configuration management, but they differ in operating model, complexity, and fit for scale.

OptionModelBest forTrade-offs
Manual shell scriptsImperative commands executed directly on hostsSmall, one-off tasksHard to keep idempotent; drift grows quickly
AnsibleAgentless automation (commonly over SSH/WinRM) with YAML playbooksTeams that want quick adoption and readable automationController design and inventory strategy matter at larger scale
PuppetDeclarative desired state with agent-based enforcementLarge fleets needing continuous state enforcementAgent and control-plane lifecycle adds operational overhead
ChefCode-driven automation with Ruby DSL, typically agent-basedComplex automation patterns and strong code customizationSteeper learning curve for teams unfamiliar with Ruby DSL
SaltRemote execution plus state management, event-driven capabilitiesTeams needing both orchestration and configuration controlArchitecture choices can increase design complexity

Hands-on example: baseline web server configuration with Ansible

This example installs and enables NGINX on a target host group named web. It demonstrates idempotent configuration management with a dry-run step before enforcement.

Inventory file

[web]
web-01 ansible_host=192.0.2.10 ansible_user=ubuntu
web-02 ansible_host=192.0.2.11 ansible_user=ubuntu

Playbook

---
- name: Configure web servers
  hosts: web
  become: true
  tasks:
    - name: Ensure nginx is installed
      ansible.builtin.package:
        name: nginx
        state: present

    - name: Ensure nginx service is enabled and running
      ansible.builtin.service:
        name: nginx
        enabled: true
        state: startedCode language: CSS (css)

Validate first, then apply

ansible-playbook -i inventory.ini web.yml --syntax-check
ansible-playbook -i inventory.ini web.yml --check --diff
ansible-playbook -i inventory.ini web.ymlCode language: CSS (css)

Minimal CI validation stage

stages:
  - validate

validate_config:
  stage: validate
  script:
    - ansible-playbook -i inventory.ini web.yml --syntax-check
    - ansible-playbook -i inventory.ini web.yml --checkCode language: CSS (css)

Common pitfalls and best practices

  • Pitfall: making emergency manual server edits and never backporting them. Best practice: every change goes through version control and pull request review.
  • Pitfall: applying directly to production first. Best practice: validate in CI, then stage, then promote.
  • Pitfall: treating configuration tools as ad-hoc scripting engines. Best practice: prefer idempotent resources and declarative patterns where possible.
  • Pitfall: weak inventory and host-group design. Best practice: model environments and roles explicitly to prevent accidental broad changes.
  • Pitfall: no drift checks after deployment. Best practice: schedule regular compliance runs and open fix changes automatically.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

How Ansible Automates Cisco IOS and IOS XE Network Devices

Introduction Managing multiple Cisco routers and switches manually can become time-consuming as a network grows. Network engineers regularly configure interfaces, check device status, update settings, and troubleshoot…

Read More

Configuration Management in DevOps: Concepts, Tooling, and a Practical Workflow

This guide explains how configuration management works in modern DevOps teams, compares common tools, and shows a practical Ansible example. It also preserves the original SlideShare reference from the legacy post.

Read More

Infrastructure as Code: A Practical Guide for DevOps Professionals

Introduction Managing infrastructure has undergone a massive transformation over the past decade. If you started your career in the era of physical data centers, you likely remember…

Read More

Staff Network Automation Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Staff Network Automation Engineer is a senior individual contributor in the Cloud & Infrastructure organization responsible for designing, building, and scaling automation systems that make network provisioning, configuration, validation, and operations reliable, fast, and repeatable. The role blends deep networking fundamentals with software engineering practices (version control, CI/CD, testing, observability) to deliver “network as code” capabilities across data center, cloud, and edge environments.

Read More

Top 10 Configuration Management Tools: Features, Pros, Cons & Comparison

Introduction Configuration Management Tools are a core pillar of modern IT operations and DevOps practices. At their foundation, these tools help organizations define, enforce, and maintain consistent…

Read More

The Complete Ansible Tutorial: Concepts, Architecture, Playbooks, and Real-World Examples

Here is a comprehensive, professional-quality Ansible tutorial based on your notes, structured as a long-form guide. Every topic, term, and example is included, with deep explanations and…

Read More