Some of the core functions interact with the remote "world" API. Move them all into the same package.
22 lines
570 B
Plaintext
22 lines
570 B
Plaintext
import "sys"
|
|
import "world"
|
|
|
|
# here are all the possible options:
|
|
#$opts = struct{strategy => "rr", max => 3, reuse => false, ttl => 10,}
|
|
|
|
# although an empty struct is valid too:
|
|
#$opts = struct{}
|
|
|
|
# we'll just use a smaller subset today:
|
|
$opts = struct{strategy => "rr", max => 2, ttl => 10,}
|
|
|
|
# schedule in a particular namespace with options:
|
|
$set = world.schedule("xsched", $opts)
|
|
|
|
# and if you want, you can omit the options entirely:
|
|
#$set = world.schedule("xsched")
|
|
|
|
file "/tmp/mgmt/scheduled-${sys.hostname()}" {
|
|
content => template("set: {{ . }}\n", $set),
|
|
}
|