Add per-node action groups with schedules, runs, and logs.
Let operators manage ordered action groups on each host, run them manually or on a schedule over SSH, and inspect disk-backed JSON run logs from a node detail UI.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package auth
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestExpandPlaceholders(t *testing.T) {
|
||||
body := "ping {{node.ip}} as {{node.username}} host={{cc.host}} env={{env.FOO}} secret={{secret.TOKEN}} unknown={{nope}}"
|
||||
got := ExpandPlaceholders(body, PlaceholderContext{
|
||||
Host: "web-1",
|
||||
IP: "10.0.0.5",
|
||||
Username: "deploy",
|
||||
Env: map[string]string{"FOO": "bar"},
|
||||
Secrets: map[string]string{},
|
||||
})
|
||||
want := "ping 10.0.0.5 as deploy host=web-1 env=bar secret= unknown="
|
||||
if got != want {
|
||||
t.Fatalf("got %q want %q", got, want)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user