From 09b0a68d6cc16190f348878284a83bcfcddfffc0 Mon Sep 17 00:00:00 2001 From: Nick Anderson Date: Thu, 4 Apr 2024 13:12:25 -0500 Subject: [PATCH] Added module to disable recommendations from the MPF Ticket: ENT-11525 Changelog: Title --- cfbs.json | 5 +++++ management/disable-recommendations/README.md | 20 ++++++++++++++++++++ management/disable-recommendations/def.json | 8 ++++++++ 3 files changed, 33 insertions(+) create mode 100644 management/disable-recommendations/README.md create mode 100644 management/disable-recommendations/def.json diff --git a/cfbs.json b/cfbs.json index 24a275e..555f71a 100644 --- a/cfbs.json +++ b/cfbs.json @@ -23,6 +23,11 @@ "subdirectory": "management/autorun-inputs", "steps": ["json def.json def.json"] }, + "disable-recommendations": { + "description": "Disable all recommendations emitted from the Masterfiles Policy Framework (MPF).", + "subdirectory": "management/disable-recommendations", + "steps": ["json def.json def.json"] + }, "client-initiated-reporting": { "description": "Enable client initiated reporting and disable pull collection.", "subdirectory": "reporting/client-initiated-reporting", diff --git a/management/disable-recommendations/README.md b/management/disable-recommendations/README.md new file mode 100644 index 0000000..2ed9263 --- /dev/null +++ b/management/disable-recommendations/README.md @@ -0,0 +1,20 @@ +The Masterfiles Policy Framework (MPF) emits recommendations for various settings given the context and role of a host. + +For example, when federated reporting is enabled on an Enterprise hub, there is a recommendation to install gnu-parallel. + +``` +R: CFEngine recommends installing gnu parallel on federated reporting superhubs. +``` + +These can be useful, but you may want to disable the functionality to quiet your policy runs. This module facilitates disabling all recommendations by defining `default:cfengine_recommendations_disabled`, it is equivalent to editing the augments file (`/var/cfengine/masterfiles/def.json`) to: + +```json +{ + "classes": { + "default:cfengine_recommendations_disabled": { + "class_expressions": [ "any::" ], + "comment": "We disabled all recommendations emitted by the MPF to quiet policy output." + } + } +} +``` diff --git a/management/disable-recommendations/def.json b/management/disable-recommendations/def.json new file mode 100644 index 0000000..715b0b4 --- /dev/null +++ b/management/disable-recommendations/def.json @@ -0,0 +1,8 @@ +{ + "classes": { + "default:cfengine_recommendations_disabled": { + "class_expressions": [ "any::" ], + "comment": "We disabled all recommendations emitted by the MPF to quiet policy output." + } + } +}