Przejdź do treści
Biblioteka skilli
DevOps i chmura · Budowanie i kod

configuration-management

/configuration-management

Opisuje zarządzanie systemami przez Ansible, Chef i Puppet: idempotentne zadania, zbieżność do stanu docelowego, organizację inwentarza i role, oraz kiedy konfigurować flotę, a kiedy ją wymieniać.

Repozytorium
devops-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
25.08.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 25.08.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Opisuje zarządzanie systemami przez Ansible, Chef i Puppet: idempotentne zadania, zbieżność do stanu docelowego, organizację inwentarza i role, oraz kiedy konfigurować flotę, a kiedy ją wymieniać.

Oryginalny opis (EN)

Covers Ansible, Chef, and Puppet for managing mutable systems declaratively — idempotent tasks, convergence toward desired state instead of one-off scripts, inventory organization, and roles. Use this whenever the user is writing a playbook, cookbook, or manifest, debugging why a run isn't converging, organizing hosts into an inventory, or deciding whether a fleet should be config-managed or replaced wholesale. For replacing servers instead of mutating them use `immutable-infrastructure`, for provisioning the underlying resources use `infrastructure-as-code`.

Jak działa

  1. 1. Write tasks that declare an outcome, not a command
  2. 2. Model the fleet as an inventory, not a list of one-off hosts
  3. 3. Package reusable logic as roles, and give each role one job
  4. 4. Converge toward state, don't script a migration path
  5. 5. Know when config management is the wrong tool
  6. 6. Test playbooks against a real target before trusting them in production
  7. Report
Sekcje z nagłówków SKILL.md, w oryginale · 117 linii, 1 013 słów
Podgląd SKILL.md
---
name: configuration-management
description: Covers Ansible, Chef, and Puppet for managing mutable systems declaratively — idempotent tasks, convergence toward desired state instead of one-off scripts, inventory organization, and roles. Use this whenever the user is writing a playbook, cookbook, or manifest, debugging why a run isn't converging, organizing hosts into an inventory, or deciding whether a fleet should be config-managed or replaced wholesale. For replacing servers instead of mutating them use `immutable-infrastructure`, for provisioning the underlying resources use `infrastructure-as-code`.
license: MIT
---

# Configuration Management

A shell script installs a package. A configuration management tool declares that the package
should be installed — and then checks, every time it runs, whether that's already true before
doing anything. That distinction is the entire value: a script run twice can fail or duplicate
work, but a well-written playbook run a hundred times against a host that's already correct does
nothing at all, safely.

Ansible, Chef, and Puppet exist to describe *desired state*, not a sequence of steps. The moment
a task is written as an imperative command instead of a declared outcome, that guarantee is gone.

**If running the same playbook twice changes anything the second time, it isn't idempotent — and
if it isn't idempotent, it isn't safe to run in a hurry, which is exactly when you'll need to.**

## 1. Write tasks that declare an outcome, not a command

`command: apt-get install -y nginx` runs every time, whether or not nginx is already there, and
Ansible has no way to know if it changed anything. The `apt` or `package` module, by contrast,
checks state first and reports back "changed" or "ok" honestly.

```yaml
- name: Ensure nginx is installed and running
  apt:
    name: nginx
    state: present
- name: Ensure nginx is enabled and running
  service:
    name: nginx
    state: started
    enabled: true
```

- **Prefer the module over the raw shell command** whenever one exists for the resource type —
  package, file, service, user — because the module already encodes the idempotency check.
- **When a shell command is unavoidable**, add an explicit `creates:`, `changed_when:`, or
  equivalent guard so the run can still report truthfully.
- **Treat every "changed" in a run against an already-configured host as a bug to investigate**,
  not background noise.

**Done when:** running the playbook twice in a row against the same host reports zero changes on
the second run.

## 2. Model the fleet as an inventory, not a list of one-off hosts

Configuration management earns its keep at scale, and that requires hosts to be grouped by role
and environment so a change can target "all web servers in staging" instead of a hand-maintained
list of IPs someone has to update every time a server is added or removed.

- **Use dynamic inventory** sourced from the cloud provider or CMDB wherever possible, so the
  inventory can't drift from what actually exists.
- **Group by function and environment**, and layer variables accordingly — defaults at the group
  level, overrides only where a specific host genuinely needs one.
- **Never hardcode a host's role into a play** — the inventory group should carry that meaning,
  so the same play works unchanged as the fleet grows.

**Done when:** adding or removing a host requires no edit to any playbook, only an inventory
change.

## 3. Package reusable logic as roles, and give each role one job

A role that configures nginx, sets up log rotation, and hardens SSH all at once can't be reused
for a host that needs only one of those things, and it's harder to test in isolation. Roles are
the module system of configuration management — see `terraform-modules` for the equivalent
discipline in Terraform, though the composition mechanics differ.

- **One role, one responsibility** — `nginx`, `log-rotation`, `ssh-hardening` as separate roles
  composed together on a host, not merged into one.
- **Parameterize with role variables that have sane defaults**, so applying a role without
  overrides still produces a working, sensible result.
- **Version and share roles that are genuinely reused** across projects via Galaxy, Puppet
  Forge, or an internal registry, pinned the same way you'd pin a Terraform module source.

**Done when:** each role can be applied to a fresh host on its own and produce a correct,
working result without depending on another role having already run.

## 4. Converge toward state, don't script a migration path

The instinct when a host is in an unknown state is to write a script that walks it from wherever
it is to where it should be. Configuration management inverts that: declare where it should end
up, and let the tool figure out what, if anything, needs to change. This is what makes it safe to
run against a fleet in mixed, unknown states — a freshly imaged host and a three-year-old one
converge to the same result from the same playbook.

**Done when:** the same playbook can be run unmodified against a brand-new host and an
existing, drifted one, and both end up in the identical target state.

## 5. Know when config management is the wrong tool

Configuration management manages long-lived, mutable hosts well. It manages the problem of "this
host has drifted and I need to reconcile it" — a problem that doesn't exist at all if hosts are
never mutated after boot. If the fleet is autoscaled, frequently replaced, or the goal is a
byte-identical fleet, baking a golden image and replacing rather than converging is usually
simpler and more reliable. See `immutable-infrastructure` for that model and how to decide
between the two.

**Done when:** the choice between config management and image-baking for this fleet is a
documented decision, not a default nobody reconsidered.

## 6. Test playbooks against a real target before trusting them in production

A playbook that's only ever been run manually against production is a playbook that's never
actually been tested — it's been performed. Run it in CI against a container or ephemeral VM,
asserting both that the first run converges and the second run is a no-op. See
`infrastructure-testing` for the broader pattern this fits into.

**Done when:** every playbook change runs through an automated convergence test before it's
applied to a real fleet.

## Report

State which roles and playbooks exist, what inventory groups they target, and whether idempotency
was verified with a two-run test. Name the honest gap — usually a play still using raw shell
commands without change guards, an inventory that's manually maintained instead of dynamic, or a
fleet that was never evaluated against the immutable-infrastructure alternative — rather than
implying the whole fleet reliably converges.

Wersje

RepozytoriumWynikLicencja
Ta strona · arjunprabhulal/devops-skills100MIT
organvm-iv-taxis/a-i--skills100Apache-2.0
nikospavlopoulos/devops-mutant-powers90MIT
andreibesleaga/gabbe90CC-BY-4.0

Migawka bazy z 13.11.2026 · wersja paczki b64d8aed0147 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90config-mgmt
    Kieruje pytania o zarządzanie konfiguracją do właściwej technologii i porównuje Chef, Puppet, SaltStack i Ansible.
  • 95ansible
    Pomaga pisać i utrzymywać playbooki Ansible: role, inwentarz, zmienne, szyfrowanie Vault, Tower i AWX.
  • 100chef-puppet-saltstack-legacy-config-management
    Porównuje Chef, Puppet i SaltStack dla zespołów utrzymujących starsze środowiska zarządzania konfiguracją obok Ansible lub zamiast niego: architektura, modele zasobów i uczciwa ocena, gdzie jeszcze mają sens.
  • 100ansible-playbook-and-role-design
    Projektuje i bezpiecznie uruchamia playbooki, role i inwentarze Ansible: idempotentne zadania, Ansible Vault dla sekretów oraz wybór między Ansible a Terraform lub CloudFormation.
  • 100ansible
    Automatyzuje zarządzanie konfiguracją i wdrożenia aplikacji z Ansible: ansible-playbook, pliki inwentarza, role, polecenia ad hoc i ansible-galaxy.
  • 100ansible-expert
    Wspiera zarządzanie konfiguracją i infrastrukturę jako kod w Ansible: architektura, inwentarz statyczny, YAML i dynamiczny, playbooki oraz role.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.