examples: lang: Refresh examples

Removed two old examples which were no longer valid.
This commit is contained in:
James Shubin
2019-03-09 18:54:50 -05:00
parent 5bbb474db6
commit da1c96c6fd
3 changed files with 18 additions and 40 deletions

View File

@@ -1,14 +1,24 @@
file "/tmp/mgmt/foo" {
content => "hello from foo\n",
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",
}
print "print0" {
kv "kv0" {
key => $ns,
#value => "two",
}
File["/tmp/mgmt/foo"].content -> Print["print0"].msg
Exec["exec0"].output -> Kv["kv0"].value
print "print1" {
msg => "hello",
if $state != "default" {
file "/tmp/mgmt/state" {
content => fmt.printf("state: %s\n", $state),
}
}
Print["print0"] -> Print["print1"]

View File

@@ -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

View File

@@ -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),
}
}