Crates are functions that encapsulate some unit of configuration or administration. Every crate must take a first argument as a session map, and must return an updated session map. Crates can take other arguments.
Composing existing crates
The simplest way of creating a crate is to compose it from existing crates or actions.
(require 'pallet.action.package) (require 'pallet.crate.git) (require 'pallet.crate.tomcat) (defn my-simple-config [session] (-> session (pallet.action.package/package "maven2") (pallet.crate.git/git) (pallet.crate.tomcat/tomcat)))
Extending Pallet’s Actions
defaction can be used to define script producing functions, that can then be called in crates.
defaggregate can be used to define actions that collect arguments over multiple invocations and emit a action based on the aggregated arguments. This is used in the sudoers crate, for example, to emit /etc/sudoers.
def-clj-action defines a action that will be run on the local machine.