Conversation
Implements phases 1 and 2 of the Choria transport, enabling OpenBolt to run tasks, commands, and scripts on nodes via Choria's NATS pub/sub messaging as an alternative to SSH and WinRM. Phase 1 (bolt_tasks agent): Downloads task files to targets from an OpenVox/Puppet Server and executes them using the bolt_tasks Choria agent. Phase 2 (shell agent): Executes commands, scripts, and tasks through the Choria shell agent. This allows running tasks not available on an OpenVox/Puppet server. Everything is implemented as asynchronously as possible, aligning with Choria's model, and is built to run at scale across many thousands of nodes at once. See docs in a later commit for details on the phases of this project as well as user-facing and developer documentation.
Attempts to minimize stubbing (although we still need a fair bit) and use the choria-mcorpc-support gem as much as possible.
- choria-transport.md: User guide covering configuration, usage, and examples - choria-transport-dev.md: Developer guide for architecture, data flow, and patterns - choria-transport-plan.md: Project plan with phased roadmap and progress tracking - choria-transport-testing.md: Test environment setup for manual verification
Add CLI flags for all Choria transport options so they can be passed on
the command line. CLI flags use a choria- prefix for clarity (e.g., --choria-config-file, --choria-ssl-ca) while
internal option keys remain unprefixed so inventory files stay clean
(e.g., choria: { config-file: /path }).
Rename choria-agent to task-agent since it only applies to task
execution. The CLI flag becomes --choria-task-agent.
New CLI flags:
--choria-task-agent, --choria-config-file, --choria-ssl-ca,
--choria-ssl-cert, --choria-ssl-key, --choria-collective,
--choria-puppet-environment, --choria-rpc-timeout,
--choria-task-timeout, --choria-command-timeout,
--nats-servers, --nats-connection-timeout
The nats-* flags are not prefixed since they are already clearly
Choria-specific. Shared options (cleanup, tmpdir, host, interpreters)
are unchanged.
BoltOptionParser::OPTIONS[:choria] needs CLI switch names (e.g., choria-config-file) not internal keys (config-file) so that remove_excluded_opts correctly includes them in --help output. Also fix task-agent -> choria-task-agent in the task run flags list.
The 11 new Choria flags added to ACTION_OPTS increase the parameter count for bolt apply, bolt command, and bolt file.
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.
Adds a Choria transport to OpenBolt, enabling task execution, command running, and script execution on nodes via Choria's NATS pub/sub messaging as an alternative to SSH and WinRM. This implements phases 1 and 2 of the transport plan (docs/choria-transport-plan.md).
Rather than opening direct connections to each node, OpenBolt sends MCollective RPC requests through a NATS broker. Nodes running the Choria server execute the requests via Ruby MCollective agents and return results over the same messaging bus. This scales well to large fleets and works through NAT/firewalls since nodes only need outbound connectivity to the broker.
Documentation (docs/)
Phase 1: bolt_tasks agent
Phase 1 delivers task execution via the bolt_tasks agent, which downloads
task files from an OpenVox/Puppet Server and executes them on target nodes.
run_taskvia bolt_tasks agent with async execution and pollingrun_command,run_scriptreturn clear per-target errors when the shellagent is not available (rather than crashing)
upload,downloadreturn "not yet supported" errorsrpcutil.pingPhase 2: shell agent
Phase 2 adds command and script execution via the shell agent, plus an
alternative task execution path that uploads task files directly instead of
downloading from an OpenVox/Puppet Server.
run_commandwith async execution, timeout, and process kill on timeoutrun_scriptwith remote tmpdir creation, script upload via base64, andcleanup
run_taskvia shell agent with support for all input methods (environment,stdin, both)
task-agentconfig and--choria-task-agentCLI flag (no automatic fallback between agents)
shell.list+shell.statusesfor scalabilityinterpretersconfig optionShared infrastructure
Transport config options
See docs for a list of all config options. I tried to expose all of the relevant knobs, but if you can think of others that should get added, let me know.
Key design decisions
Future phases (not in this PR)