pallet.action documentation
Actions implement the conversion of phase functions to script and other execution code.
An action has an :action-type. Known types include :script/bash
and :fn/clojure.
An action has a :location, with a value of :origin for execution on the
node running pallet, and :target for the target node.
An action has an :execution, which is one of :aggregated, :in-sequence
or :collected. Calls to :aggregated actions will be grouped, and run
before :in-sequence actions. Calls to :collected actions will be grouped,
and run after :in-sequence actions.
action
Define an anonymous action
action-fn
Retrieve the action-fn that is used to execute the specified action.
action-metadata
Compute action metadata from precedence specification in session
aggregated-action
Define a remotely executed aggregated action function, which will be executed before :in-sequence actions.
as-clj-action
An adaptor for using a normal function as a local action function
bash-action
Define a remotely executed bash action function.
clj-action
Define a clojure action to be executed on the origin machine.
collected-action
Define a remotely executed collected action function, which will be executed after :in-sequence actions.
def-action-def
Define a macro for definining action defining vars
enter-scope
Enter a new action scope.
leave-scope
Leave the current action scope.
schedule-action
Registers an action in the action plan. The action is generated by the specified action function and arguments that will be applied to the function when the action plan is executed.
The action can be scheduled within one of three 'executions' (conceptually, sub-phases):
:in-sequence
: The generated action will be applied to the node "in order", as it is
defined lexically in the source crate. This is the default.
:aggregated
: All aggregated actions are applied to the node in the order they are
defined, but before all :in-sequence actions. Note that all of the
arguments to any given action function are gathered such that there is
only ever one invocation of each fn within each phase.
:collected
: All collected actions are applied to the node in the order they are
defined, but after all :in-sequence action. Note that all of the
arguments to any given action function are gathered such that there is
only ever one invocation of each fn within each phase.
The action-type determines how the action should be handled:
:script/bash
: action produces bash script for execution on remote machine
:fn/clojure
: action is a function for local execution
:transfer/to-local
: action is a function specifying remote source and local destination.
:transfer/from-local
: action is a function specifying local source and remote destination.
with-precedence
Set up local precedence relations between actions