From 4fc92316b9deb16c8a6f80d0d0c1a80d3c372176 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Thu, 9 Jan 2025 13:47:19 +0100 Subject: [PATCH 1/2] Improved the README for the autorun module Signed-off-by: Ole Herman Schumacher Elgesem --- management/autorun/README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/management/autorun/README.md b/management/autorun/README.md index e96fc85..329f5fe 100644 --- a/management/autorun/README.md +++ b/management/autorun/README.md @@ -1,3 +1,26 @@ -# Enable autorun +This module enables autorun functionality so you can add policy files to `services/autorun` and tag bundles with `autorun` causing them to be automatically discovered and run. -Simple module to enable autorun functionality, using def.json. +A policy file you add to `services/autorun` could look like this: + +```cfengine3 +bundle agent my_example +{ + meta: + "tags" + slist => { "autorun" }; + reports: + "Hello, world!" +} +``` + +With autorun enabled, the policy file would be parsed and the bundle evaluated without editing any of your existing files / policy. + +It uses the augments file to achieve this, it is the same as editing your `def.json` file like this: + +```json +{ + "classes": { + "services_autorun": ["any"] + } +} +``` From 1d721a6f1d02cf8adf45340b4ac6c8ce7974af70 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem <4048546+olehermanse@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:54:21 +0100 Subject: [PATCH 2/2] Code review suggestion Co-authored-by: Lars Erik Wik <53906608+larsewi@users.noreply.github.com> --- management/autorun/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/autorun/README.md b/management/autorun/README.md index 329f5fe..5f14385 100644 --- a/management/autorun/README.md +++ b/management/autorun/README.md @@ -13,7 +13,7 @@ bundle agent my_example } ``` -With autorun enabled, the policy file would be parsed and the bundle evaluated without editing any of your existing files / policy. +With autorun enabled, the policy file would be parsed, and the bundle evaluated without editing any of your existing files / policy. It uses the augments file to achieve this, it is the same as editing your `def.json` file like this: