Concept and mechanism
Module state names are specific contracts. In package management, present ensures presence and does not mean always upgrading to the newest version. If requirements include an exact version, specify it through the supported mechanism and confirm repositories used.
In systemd, started addresses current execution and enabled addresses startup activation; neither replaces the other. For firewalld in an existing zone with a running daemon, distinguish permanent configuration from runtime and decide whether both should change.
Operations on new zones have additional constraints and should not be inferred from an existing-zone rule example.
Guided application
Mounts follow another distinction: present manages the persistent entry, mounted includes an active mount, and ephemeral does not represent fstab persistence. Choose from the objective rather than the most convenient-sounding name. For user management, set append explicitly when adding supplementary groups while retaining existing ones; avoid depending on defaults that vary across documentation versions.
For cron, use a stable name identifying the managed job instead of creating a new identity on every execution. In a fictional scenario, service communicates until reboot and then fails because its rule existed only at runtime. Acceptance should observe post-reboot state, including the application flow and operational access required for recovery.
Inspect the reference and the object
The lab creates current as a symbolic link to stable.conf. Two stat calls answer different questions: without following the link, islnk identifies the reference; with follow:true, inspection presents the regular file and its mode. Choose observations according to requirements.
If the request requires removing only current, state:absent removes the link while stable.conf retains its bytes. Acceptance checks both conditions. Merely failing to open current is insufficient because it may also indicate a dangling link whose target disappeared.
Before removing paths in a real environment, confirm object type and approved scope. This exercise acts only on references created inside its directory; it does not remove operational data or traverse production paths.
Replacing a path does not update every consumer
Before publishing 9090, the runner creates a hard link to the file containing 8080 and opens a read descriptor. After copy, reopening path stable.conf returns 9090 and that path’s inode has changed. The hard link and already-open descriptor continue reading 8080.
These observations explain why publishing configuration does not prove a process adopted it. The Linux rename manual describes the relationship with descriptors and hard links; this lab actually ran locally on macOS and does not validate a RHEL service.
For a specific application, identify whether it reopens the file, retains a descriptor, loads values into memory or requires a reload operation. Rehearsing that protocol and observing the consumer are separate steps from checking path contents.
Do not replace safe operations with unsafe_writes as an activation shortcut.
Apply permissions according to object type
Directory existing-tree starts at 0777. Copy uses directory_mode 0750 and publishes payload.txt at 0640, but the existing directory remains 0777. The creation parameter did not repair that object.
An explicit file task changes the parent to 0750 without altering the child when nonrecursive. Next, recurse:true with mode 0750 also makes the regular file executable. When requirements distinguish directory traversal from data reading, apply separate policies to object types.
Avoid correcting the whole branch to 0640 because that removes required parent traversal. In this exercise, a specific task restores the child to 0640. Retain effective modes after each phase and compare them with the approved access matrix.
Do not assume the parent mode was inherited or that a child’s mode corrected the directory.
Creating contents and checking the service are different steps
The final experiment requests state:file for never-created, a nonexistent path. The task fails and the file remains absent. If requirements include publishing known bytes, use an operation that creates those contents and declares necessary attributes.
Do not ignore failure merely to obtain a green recap. To practise RUN handover, write acceptance criteria for object type, resolved target, contents, mode and activation protocol. Predict rerun results and the outcome of introducing controlled drift.
This lab demonstrates local modules without SSH, ACL, SELinux, service or reboot verification. Connect file observations with earlier lesson sections on packages, units, firewall and mounts: each layer needs its own evidence. The handover summary should state precisely what was applied, observed and still needs rehearsal.
Started without enabled can leave a service healthy now and absent after startup.
Common pitfalls
Present as latest; runtime as permanent; changing name as stable identity.
Related topics: State and repeatability · Inventories, variables, and configuration · Access and execution environment
Inspect the right object and check how the consumer adopts published state.
References
- Service state and boot enablement · Current primary reference inspected 2026-09-30
- Copy contents and metadata · Current primary reference; original local module experiment pinned to core 2.19.0
- Manage filesystem objects · Current primary reference; original local module experiment pinned to core 2.19.0
- Inspect filesystem status · Current primary reference; original local module experiment pinned to core 2.19.0
- Check-mode predictions · Current primary reference; original local module experiment pinned to core 2.19.0
- Change reporting and error handling · Current primary reference; original local module experiment pinned to core 2.19.0
- Linux rename manual: descriptors and links · Current Linux primary manual; separate local macOS experiment, not RHEL runtime verification