examples: lang: Refresh examples
Removed two old examples which were no longer valid.
This commit is contained in:
@@ -1,14 +1,24 @@
|
|||||||
file "/tmp/mgmt/foo" {
|
import "fmt"
|
||||||
content => "hello from foo\n",
|
import "world"
|
||||||
|
|
||||||
|
$ns = "estate"
|
||||||
|
$exchanged = world.kvlookup($ns)
|
||||||
|
$state = maplookup($exchanged, $hostname, "default")
|
||||||
|
|
||||||
|
exec "exec0" {
|
||||||
|
cmd => "echo hello world && echo goodbye world 1>&2", # to stdout && stderr
|
||||||
|
shell => "/bin/bash",
|
||||||
}
|
}
|
||||||
|
|
||||||
print "print0" {
|
kv "kv0" {
|
||||||
|
key => $ns,
|
||||||
|
#value => "two",
|
||||||
}
|
}
|
||||||
|
|
||||||
File["/tmp/mgmt/foo"].content -> Print["print0"].msg
|
Exec["exec0"].output -> Kv["kv0"].value
|
||||||
|
|
||||||
print "print1" {
|
if $state != "default" {
|
||||||
msg => "hello",
|
file "/tmp/mgmt/state" {
|
||||||
|
content => fmt.printf("state: %s\n", $state),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Print["print0"] -> Print["print1"]
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
file "/tmp/mgmt/foo" {
|
|
||||||
content => "hello from foo\n",
|
|
||||||
}
|
|
||||||
|
|
||||||
file "/tmp/mgmt/bar" {
|
|
||||||
}
|
|
||||||
|
|
||||||
File["/tmp/mgmt/foo"].content -> File["/tmp/mgmt/bar"].content
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import "fmt"
|
|
||||||
import "world"
|
|
||||||
|
|
||||||
$ns = "estate"
|
|
||||||
$exchanged = world.kvlookup($ns)
|
|
||||||
$state = maplookup($exchanged, $hostname, "default")
|
|
||||||
|
|
||||||
exec "exec0" {
|
|
||||||
cmd => "echo hello world && echo goodbye world 1>&2", # to stdout && stderr
|
|
||||||
shell => "/bin/bash",
|
|
||||||
}
|
|
||||||
|
|
||||||
kv "kv0" {
|
|
||||||
key => $ns,
|
|
||||||
#value => "two",
|
|
||||||
}
|
|
||||||
|
|
||||||
Exec["exec0"].output -> Kv["kv0"].value
|
|
||||||
|
|
||||||
if $state != "default" {
|
|
||||||
file "/tmp/mgmt/state" {
|
|
||||||
content => fmt.printf("state: %s\n", $state),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user