Added cfengine run, a "smart" wrapper around cf-remote run with some added niceties#176
Merged
Merged
Conversation
…added niceties `cfengine run` is a wrapper around the run functionality from cf-remote. Allows the user to run CFEngine policy on remote/local installations with the same command. - Auto-discovers cf-agent locally and across all hosts known to cf-remote (via its saved/spawned state), instead of requiring the user to know or specify where it's installed. - When multiple installations are found, prompts interactively for which one to use; add --host <name|ip> to skip the prompt and select one directly, non-interactively. - Installations can be selected by cf-remote's own friendly names (e.g. --host hub), not just IP address. - Runs cf-agent as root automatically when needed (both locally via sudo and remotely via cf-remote), so cf-agent picks up policy from /var/cfengine instead of falling back to the invoking user's home directory. - Bare filenames are accepted directly (`cfengine run mypolicy.cf`); -KIf is inserted automatically unless flags are already present. Has some added classes and utils to easily adapt the rest of the wanted future features such as: report, spawn/destroy, etc. Ticket: ENT-14120 Changelog: None Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
88d75f0 to
b4fb82a
Compare
olehermanse
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cfengine runis a wrapper around the run functionality from cf-remote. Allows the user to run CFEngine policy on remote/local installations with the same command.cfengine run mypolicy.cf); -KIf is inserted automatically unless flags are already present.Has some added classes and utils to easily adapt the rest of the wanted future features such as: report, spawn/destroy, etc.
Ticket: ENT-14120
Changelog: None