This may have lots of uses, particularly for bootstrapping and handoff if we want to compress payloads. It is also a good model resource for how to implement such a resource to avoid re-computing the result on every CheckApply call. Of course if the computation is cheaper than the hashing of the data this isn't the optimal approach.
18 lines
376 B
Plaintext
18 lines
376 B
Plaintext
# gzip a file!
|
|
file "/tmp/input" {
|
|
state => "exists",
|
|
content => "hello world from purpleidea!\n",
|
|
}
|
|
|
|
gzip "/tmp/input.gz" {
|
|
input => "/tmp/input",
|
|
level => $const.res.gzip.level.no_compression,
|
|
|
|
Depend => File["/tmp/input"], # TODO: add autoedges
|
|
}
|
|
|
|
gzip "/tmp/data.gz" {
|
|
content => "hello world from purpleidea!\n",
|
|
level => $const.res.gzip.level.best_compression,
|
|
}
|