Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCmd ¶
ExecCmd executes one of available commands: list, host and inventory. It checks if a tfstate is given in command line argument or not. If yes, it will use it. Otherwise, it checks 2 environment variables TF_BIN (path to terraform binary) and TF_DIR (path to terraform folder). If they are set, so `terraform state pull` is executed automatically to get Terrafrm tftstate to parse.
Types ¶
type Group ¶
type Group struct { Name string `json:"-"` Vars map[string]interface{} `json:"vars"` Hosts []string `json:"hosts"` }
Group represents an Ansible inventory group
type Host ¶
type Host struct { Name string `json:"-"` GroupName string `json:"-"` Vars map[string]interface{} `json:"vars"` }
Host represents an Ansible inventory host
type Module ¶
type Module struct { Path []string `json:"path"` Outputs map[string]Output `json:"outputs"` Resources map[string]Resource `json:"resources"` DependsOn []string `json:"depends_on"` }
Module represents module element in Terraform tfstate
type Output ¶
type Output struct { Sensitive bool `json:"sensitive"` Type string `json:"type"` Value interface{} `json:"value"` }
Output represents output characteristics in Terraform tfstate
type Primary ¶
type Primary struct { ID string `json:"id"` Attributes map[string]string `json:"attributes"` Meta map[string]interface{} `json:"meta"` Tainted bool `json:"tainted"` }
Primary represents a primary element in Terraform tfstate
type Resource ¶
type Resource struct { Type string `json:"type"` DependsOn []string `json:"depends_on"` Primary Primary `json:"primary"` Deposed []string `json:"deposed"` Provider string `json:"provider"` }
Resource represents a resource element in Terraform tfstate
type TFState ¶
type TFState struct {
Modules []Module `json:"modules"`
}
TFState is a struct representing terraform tfstate
type TFStateParsed ¶
TFStateParsed represents a tfstate under Ansible inventory format