Skip to content

Commit 11de75c

Browse files
03_configuration_engine.md (#3000)
* 03_configuration_engine.md Grammar check * Improve introduction to cloud-init modules Reword one passive voice phrase to active voice by also rewording the original for better clarity. --------- Co-authored-by: sspencerwire <sspencerwire@gmail.com>
1 parent ad2a159 commit 11de75c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/guides/virtualization/cloud-init/03_configuration_engine.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ tags:
1111

1212
## Deep dive into cloud-init modules
1313

14-
In the last chapter, you successfully booted a cloud image and performed a simple customization. While effective, the true power, portability, and you unlock idempotency of `cloud-init` through its module system. These modules are the specialized tools in the `cloud-init` toolkit, designed to handle specific configuration tasks in a declarative and predictable way.
14+
In the last chapter, you successfully booted a cloud image and performed a simple customization. While effective, you unlock the true power, portability, and idempotency of `cloud-init` with its module system. These modules are specialized tools in the `cloud-init` toolkit, designed to handle specific configuration tasks in a declarative, predictable way.
1515

1616
This chapter dives deep into the module system, explaining what modules are, how they work, and how to use the most essential ones to build a well-configured server.
1717

1818
## 1. The anatomy of configuration
1919

2020
### What are cloud-init modules
2121

22-
A `cloud-init` module is a specialized Python script designed to handle a single, discrete provisioning task. Think of them as plugins for tasks such as managing users, installing packages, or writing files.
22+
A `cloud-init` module is a specialized Python script designed to handle a single, discrete provisioning task. Think of them as plugins for functions like user management, package installation, and file writing.
2323

24-
The key advantage of using modules over simple scripts (like `runcmd`) is **idempotency**. An idempotent operation produces the same result whether you run it once or ten times. When you declare that a user should exist, the module ensures that state is met—it will create the user if it does not exist, but do nothing if it already does. This makes your configurations reliable and repeatable.
24+
The key advantage of using modules over simple scripts (like `runcmd`) is **idempotency**. An idempotent operation produces the same result whether you run it once or ten times. When you declare that a user should exist, the module ensures the state is met—it creates the user if it does not exist, but does nothing if it already does. This makes your configurations reliable and repeatable.
2525

2626
### The `#cloud-config` format revisited
2727

28-
When `cloud-init` sees the `#cloud-config` header, it interprets the file as a YAML-formatted instruction set. The top-level keys in this YAML file map directly to `cloud-init` modules.
28+
When `cloud-init` sees the `#cloud-config` header, it interprets the file as a YAML-formatted instruction set — the top-level keys in this YAML file map directly to `cloud-init` modules.
2929

3030
### Module execution and order
3131

32-
Modules run at specific stages of the boot process in a sequence defined in `/etc/cloud/cloud.cfg`. A simplified view of this flow looks such as this:
32+
Modules run at specific stages of the boot process in a sequence defined in `/etc/cloud/cloud.cfg`. A simplified view of this flow looks like this:
3333

3434
```
3535
System Boot
@@ -91,7 +91,7 @@ In this example, we will provision a new, dedicated administrative user named `s
9191
9292
**Example 2: Modifying the default user**
9393
94-
A more common task is to simply secure the default user provided with the cloud image (`rocky`). Here, we will modify this user to add our SSH key.
94+
A more common task is to secure the default user provided with the cloud image (`rocky`). Here, we will modify this user to add our SSH key.
9595
9696
1. **Create `user-data.yml`:**
9797
@@ -117,7 +117,7 @@ A more common task is to simply secure the default user provided with the cloud
117117
118118
The `packages` module provides a declarative way to manage the software on your instance, ensuring the installation of specific applications at boot time.
119119
120-
In this example, we will ensure the installation of two useful tools, `nginx` (a high-performance web server) and `htop` (an interactive process viewer). We will also instruct `cloud-init` to update the package repository metadata first to ensure it can find the latest versions.
120+
In this example, we will ensure the installation of two useful tools, `nginx` (a high-performance web server) and `htop` (an interactive process viewer). We will also instruct `cloud-init` to update the package repository metadata first, ensuring it can find the latest versions.
121121
122122
1. **Create `user-data.yml`:**
123123
@@ -140,7 +140,7 @@ In this example, we will ensure the installation of two useful tools, `nginx` (a
140140
141141
!!! note "Idempotency in action"
142142
143-
If you were to reboot this VM with the same `user-data`, the `packages` module would see that `nginx` and `htop` are already installed and do nothing further. It ensures the desired state (packages are present) without taking unnecessary action. That is idempotency.
143+
If you were to reboot this VM with the same `user-data`, the `packages` module would see that `nginx` and `htop` are already installed and take no further action. It ensures the desired state (packages are present) without taking unnecessary action. That is idempotency.
144144
145145
### Module deep dive: `write_files`
146146

0 commit comments

Comments
 (0)