Documentation
¶
Index ¶
- func Apply(binDir, dir string) error
- func Destroy(binDir, dir string) error
- func ExtractModule(module string, destdir string) error
- func Init(binDir, dir string) error
- func InstallLibvirtProvider(destdir string, version string) error
- func InstallTerraform(destdir string, version string) error
- func LinkLibvirtProvider(srcDir string, version string) error
- func ParseVariableDefault(v Variable, val interface{}) error
- func ShowModuleVariable(val interface{})
- func WriteModuleConfig(dst io.Writer, conf Config) error
- type Config
- type Machine
- type Meta
- type Module
- type Provider
- type ProviderInfo
- type ReqProvider
- type VarMachines
- type VarString
- type Variable
- type Variables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractModule ¶
ExtractModule extract the terraform module embedded into the binary to a directory
func Init ¶
Init runs terraform init in the target directory, the main.tf configuration file must exist in the directory
func InstallLibvirtProvider ¶
func InstallTerraform ¶
Install downloads, checks and install terraform into the target directory
func LinkLibvirtProvider ¶
func ParseVariableDefault ¶
func ShowModuleVariable ¶
func ShowModuleVariable(val interface{})
Types ¶
type Config ¶
type Config struct { Provider Provider `hcl:"provider,block"` Module Module `hcl:"module,block"` Meta Meta `hcl:"terraform,block"` }
func NewConfiguration ¶
func ParseModuleConfig ¶
type Machine ¶
type Machine struct { IPAddress string `cty:"ip"` // "10.10.0.3" Distrib string `cty:"distrib"` // "debian10" Vcpus int `cty:"vcpu"` Memory int `cty:"memory"` DataDiskSize int `cty:"data_size"` Iface string `cty:"iface"` }
Since Machine is an object inside terraform, we need to use tags of the lower level "github.com/zclconf/go-cty/cty" module used by hcl to load it.
type Meta ¶
type Meta struct { TfVersion string `hcl:"required_version"` ReqProviders ReqProvider `hcl:"required_providers,block"` }
type Module ¶
type Module struct { Name string `hcl:"name,label"` Source string `hcl:"source"` StoragePool string `hcl:"storage_pool,optional"` Username string `hcl:"user_name,optional"` SshPubKey string `hcl:"user_pubkey,optional"` Domain string `hcl:"dns_domain"` NetworkName string `hcl:"net_name,optional"` NetworkCIDR string `hcl:"net_cidr"` Machines map[string]Machine `hcl:"vms"` // hostname -> Machine }
type ProviderInfo ¶
type ReqProvider ¶
type ReqProvider struct {
Libvirt ProviderInfo `hcl:"libvirt,optional"`
}
type VarMachines ¶
Click to show internal directories.
Click to hide internal directories.