Crates are namespaces that encapsulate some unit of configuration or administration. A crate contains plan functions. A plan function is an ordinary clojure function.

The pallet.crate/defplan macro is used to create a plan function that provides a context used in log output.

Composing Existing Crates and Actions

The simplest way of creating a crate is to compose it from existing crates or actions. In this example we assume there is a git and a tomcat crate.

(require '[pallet.crate :refer [defplan]])
(require '[pallet.actions :refer [package]])
(require '[pallet.crate.git :refer [git]])
(require '[pallet.crate.tomcat :refer [tomcat]])

(defplan my-simple-config
  []
  (package "maven2")
  (git)
  (tomcat))

Parameters

Delayed Arguments

Templates

Extending Pallet's Actions

Creating actions

defaction can be used to define script producing functions, that can then be called in crates.

Aggregate action

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.

Local actions

def-clj-action defines a action that will be run on the local machine.