diff --git a/src/docs.html b/src/docs.html index 9279756..64f9943 100644 --- a/src/docs.html +++ b/src/docs.html @@ -67,6 +67,7 @@ JinjaTurtle templates Config file Drift detection with enroll diff + Why did Enroll include/exclude something? enroll explain Tips
@@ -480,6 +481,57 @@ sudo journalctl -u enroll-harvest-diff.service -n 200 --no-pager +
+

Why did Enroll include/exclude something? enroll explain

+

When you run enroll harvest, Enroll records why it chose to include or exclude each path in state.json. The enroll explain subcommand summarizes that data so you can quickly sanity-check a harvest, tune include/exclude rules, and understand where packages/services came from.

+ +
+
What can it read?
+
enroll explain accepts a harvest bundle directory, a direct path to state.json, a .tar.gz/.tgz bundle, or an encrypted .tar.gz.sops bundle.
+
+ +
+ +
$ enroll explain /tmp/enroll-harvest
+
+# or point at the state.json path directly
+$ enroll explain /tmp/enroll-harvest/state.json
+
+ +
+

The default output is human-readable text. For scripting or deeper inspection, use JSON output:

+
+ +
$ enroll explain /tmp/enroll-harvest --format json | jq .
+
+# show more example paths per reason
+$ enroll explain /tmp/enroll-harvest --max-examples 10
+
+ +
+

If you stored a harvest as a single SOPS-encrypted bundle, enroll explain can decrypt it on the fly (it will also auto-detect files ending with .sops):

+
+ +
$ enroll explain /var/lib/enroll/harvest.tar.gz.sops --sops
+
+ +
+

What you get back:

+ + +
+
Tip
+
Use enroll explain after a first harvest to decide what to exclude (noise) and what to include (snowflake app/config under /opt, /srv, etc.) before you generate a manifest.
+
+
Security note: enroll explain doesn't print file contents, but it can print path names and unit/package names. Treat the output as sensitive if your environment uses revealing path conventions (and especially if you harvested with --dangerous).
+
+
+ +

Tips

diff --git a/src/examples.html b/src/examples.html index 568b28f..b5d8f9e 100644 --- a/src/examples.html +++ b/src/examples.html @@ -123,6 +123,23 @@

Use it in cron or CI to alert on change.

+ +
+
+
Explain a harvest with enroll explain
+
+ +
$ enroll explain /tmp/enroll-harvest
+
+# machine-readable (reasons, examples, inventory breakdown)
+$ enroll explain /tmp/enroll-harvest --format json | jq .
+
+# encrypted bundle
+$ enroll explain /var/lib/enroll/harvest.tar.gz.sops --sops
+
+

Great for answering "why did it include/exclude that file?" before you generate a manifest.

+
+