zap/README.adoc

90 lines
2.1 KiB
Plaintext
Raw Normal View History

2020-12-29 06:12:45 +00:00
= Zap
A simple cross-platform orchestration and configuration management tool.
The main goal for Zap is to a simple mechanism for managing groups of computers
with varying configurations and needs. Zap accomplishes this with "tasks" which
can be composed into "plans" or run standalone. These tasks can be collections
of scripts or a statically linked binaries, which will be pushed to the target
machine(s) and executed.
Zap borrows ideas from
link:https://puppet.com/docs/bolt/latest/bolt.html[Puppet Bolt]. but leaves
some of the Puppet-based legacy from Bolt behind.
== Examples
2020-12-29 06:12:45 +00:00
[source]
----
zap task tasks/echo.ztask -p msg="Hello World" -t zap-freebsd
Running task with: TaskOpts { task: "tasks/echo.ztask", parameter: ["msg=Hello World"], targets: "zap-freebsd" }
Hello World
2020-12-30 17:43:02 +00:00
----
[source]
----
zap plan ./examples/basic.zplan -t zap-freebsd
Running plan with: PlanOpts { plan: "./examples/basic.zplan", targets: "zap-freebsd" }
Hello from the wonderful world of zplans!
This is nice
----
=== Task
A task is a simple container of some form of execution. Typically this will be
a wrapped shell/ruby/python script which does some specific piece of
functionality. Tasks may also take parameters, which allow for some
pluggability of new values.
Tasks have some default parameters that should not be overridden in new task
definitions.
2020-12-31 19:19:05 +00:00
.Built-in Parameters
|===
| Parameter | Description
| `provides`
| A relative or absolute path to a file that the task provides. If the file exists, then the task will be skipped.
|===
.echo.ztask
[source]
2020-12-31 19:19:05 +00:00
----
task Echo {
parameters {
msg {
required = true
help = 'String to echo back to the client'
type = string
}
}
script {
inline = 'echo {{msg}}'
}
}
----
2020-12-30 17:43:02 +00:00
=== Plan
2020-12-30 17:43:02 +00:00
A plan is a collection of tasks which can be applied to a target or targets.
Tasks are referenced with the parameters that should be passed into them, and
will be executed in the order that they are defined.
2020-12-30 17:43:02 +00:00
.simple.zplan
[source]
----
task 'tasks/echo.ztask' {
msg = 'Hello from the wonderful world of zplans!'
}
task 'tasks/echo.ztask' {
msg = 'This is nice'
}
----