engine: resources: Add a creates field for exec

This adds a standard gate that prevents execution if a file exists. Of
note, this also adds a watch on it, so we can have a proper watched exec
resource without a watch cmd.
This commit is contained in:
James Shubin
2024-03-16 01:04:59 -04:00
parent 4d18044851
commit 849de648f0
2 changed files with 50 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
exec "exec0" {
cmd => "echo hello world > /tmp/whatever",
shell => "/bin/bash",
creates => "/tmp/whatever", # a watch event is taken on this file path!
}