Prepare an approved file
In Playbooks and Schedules add a file to the directory. Specify a clear name, for example,app.conf, and download the contents. The card saves the size and checksum; the material is stored encrypted.
Before the first replacement, download the current configuration from the node and save it as a separate source version. The Telepúrte directory does not automatically back up each file that will be overwritten on the server.
Apply the content
Add to the playbook Apply the configuration file and ask:- artifact from the catalog;
- an absolute path, such as
/etc/example/app.conf; 0600,0640or0644mode according to application requirements.
Check unchanged
Action. Check the configuration file It uses the same artifact, path and mode, but it doesn’t rewrite the file. It compares content and rights.
For example, if the text matched, but the file became available to everyone instead of
0600, the check will also detect a discrepancy, such a check is convenient on a schedule and does not require regular overwriting of the already correct file.
Example of a work cycle
- Save the original configuration of the test machine.
- Add the new version of
app.confto the catalog. - Create a file application playbook with a precise path and mode.
- Run it on a test node and check the application with a regular validator.
- Create a separate reading playbook to check out the same artifact.
- Check with
unchanged, then set up the check schedule for work purposes.
drifted, first determine if the change is an error or a new agreed-upon state. Do not correct it by automatically overwriting without understanding the cause.
A history of discrepancies
Telepúrte stores the last successful observation of the node + path pair, the expected artifact, the actual checksum, the mode and the time of verification. A transition event appears when the state or approved base changes. Repeating the same discrepancy updates the observation without creating the same notification each time. Changing the approved file is changing the comparison base, matching the new database does not mean that the previous configuration has been restored. The content of the file is not copied to the divergence event. The results are visible in the tasks; the summary and discrepancies history are available through the readable APIs/api/v1/config-drift and /api/v1/config-drift/events. This is not continuous observation of the file system: the state is current at the time of the last validation performed.
Verification
After application, re-read the file, check the rights and the application. After the control task, check the time, path and ID of the artifact, not just the wordunchanged. Obsolete observation does not confirm the current state.
