You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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>
Copy file name to clipboardExpand all lines: docs/guides/virtualization/cloud-init/03_configuration_engine.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,25 +11,25 @@ tags:
11
11
12
12
## Deep dive into cloud-init modules
13
13
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.
15
15
16
16
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.
17
17
18
18
## 1. The anatomy of configuration
19
19
20
20
### What are cloud-init modules
21
21
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.
23
23
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.
25
25
26
26
### The `#cloud-config` format revisited
27
27
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.
29
29
30
30
### Module execution and order
31
31
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:
33
33
34
34
```
35
35
System Boot
@@ -91,7 +91,7 @@ In this example, we will provision a new, dedicated administrative user named `s
91
91
92
92
**Example 2: Modifying the default user**
93
93
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.
95
95
96
96
1. **Create `user-data.yml`:**
97
97
@@ -117,7 +117,7 @@ A more common task is to simply secure the default user provided with the cloud
117
117
118
118
The `packages` module provides a declarative way to manage the software on your instance, ensuring the installation of specific applications at boot time.
119
119
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.
121
121
122
122
1. **Create `user-data.yml`:**
123
123
@@ -140,7 +140,7 @@ In this example, we will ensure the installation of two useful tools, `nginx` (a
140
140
141
141
!!! note "Idempotency in action"
142
142
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.
0 commit comments