1
1
mirror of https://github.com/adammck/terraform-inventory synced 2024-11-22 20:01:58 +01:00

Not outputting the global variables if no outputs are set.

This commit is contained in:
Lazar Travica 2016-02-18 11:46:40 +01:00
parent 6ead28eee6
commit 99ff88b3ce
2 changed files with 7 additions and 5 deletions

8
cli.go

@ -22,9 +22,11 @@ func cmdList(stdout io.Writer, stderr io.Writer, s *state) int {
}
}
groups["all"] = make(map[string]string, 0)
for _, out := range s.outputs() {
groups["all"].(map[string]string)[out.keyName] = out.value
if(len(s.outputs()) > 0) {
groups["all"] = make(map[string]string, 0)
for _, out := range s.outputs() {
groups["all"].(map[string]string)[out.keyName] = out.value
}
}
return output(stdout, stderr, groups)

@ -1,5 +1,5 @@
- hosts:
- web-aws
- web-do
- alpha
- beta
tasks:
- command: "echo Hello, world!"