-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing Terraform outputs as "global" variables in the Ansible dynami…
…c inventory json.
- Loading branch information
Lazar Travica
committed
Feb 16, 2016
1 parent
2292023
commit 6ead28e
Showing
4 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
type Output struct { | ||
|
||
// The keyName and value of the output | ||
keyName string | ||
value string | ||
} | ||
|
||
func NewOutput(keyName string, value string) (*Output, error) { | ||
|
||
// TODO: Warn instead of silently ignore error? | ||
if len(keyName) == 0 { | ||
return nil, fmt.Errorf("couldn't parse keyName: %s", keyName) | ||
} | ||
|
||
return &Output{ | ||
keyName: keyName, | ||
value: value, | ||
}, nil | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters