How to get ansible log as JSON?
dikkini opened this issue · comments
I've read doc but i did not understand, how to get ansible log as JSON?
playbook := &ansibler.AnsiblePlaybookCmd{
Playbook: fmt.Sprintf(playbookPath, "test"),
Options: ansiblePlaybookOptions,
Writer: &AnsibleLog{},
StdoutCallback: "json",
}
code below make a panic
panic: send on closed channel
goroutine 7 [running]:
github.com/apenella/go-ansible/execute.(*DefaultExecute).Execute.func1(0xc0001c2080, 0x0, 0x0, 0x16e5b00, 0xc0000106b0, 0xc000028840, 0xc0000287e0)
/Users/dikkini/go/pkg/mod/github.com/apenella/go-ansible@v0.5.1/execute/defaultExecute.go:92 +0x158
created by github.com/apenella/go-ansible/execute.(*DefaultExecute).Execute
/Users/dikkini/go/pkg/mod/github.com/apenella/go-ansible@v0.5.1/execute/defaultExecute.go:82 +0x508
Exiting.
Also, there is a misstake in example https://github.com/apenella/go-ansible/blob/master/examples/simple-ansibleplaybook-json/simple-ansibleplaybook-json.go#L41
Error: Cannot use 'buff.Bytes()' (type []byte) as type *bufio.Reader
I updated to 0.8.0 version and everything is fine. thank you :D