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:
6
examples/lang/exec-creates.mcl
Normal file
6
examples/lang/exec-creates.mcl
Normal 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!
|
||||
}
|
||||
Reference in New Issue
Block a user