Skip to content

Added cfengine run, a "smart" wrapper around cf-remote run with some added niceties#176

Merged
olehermanse merged 1 commit into
cfengine:mainfrom
SimonThalvorsen:ENT-14120
Jul 10, 2026
Merged

Added cfengine run, a "smart" wrapper around cf-remote run with some added niceties#176
olehermanse merged 1 commit into
cfengine:mainfrom
SimonThalvorsen:ENT-14120

Conversation

@SimonThalvorsen

Copy link
Copy Markdown
Contributor

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

…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>
@olehermanse olehermanse merged commit 26b8a56 into cfengine:main Jul 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants