yml

package
v0.0.0-...-84310d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadInventory

func LoadInventory(f string) (server.InventoryConfiguration, []*server.Host, map[string]interface{}, error)

LoadInventory loads inventory from a yaml file

Types

type Host

type Host struct {
	Network    string            `yaml:"network,omitempty"`
	ID         string            `yaml:"id,omitempty"`
	Labels     []string          `yaml:"labels,omitempty"`
	Properties map[string]string `yaml:"properties,omitempty"`
	Address    string            `yaml:"address,omitempty"`
	Addresses  []struct {
		Address string `yaml:"address"`
		Name    string `yaml:"name"`
	} `yaml:"addresses"`
	SSH           *SSH        `yaml:"ssh,omitempty"`
	Configuration interface{} `yaml:"configuration,omitempty"`
}

Host defines a YAML host

type Inventory

type Inventory struct {
	PrivateKeyFile string              `yaml:"privateKey,omitempty"`
	Passphrase     string              `yaml:"passphrase,omitempty"`
	Configuration  interface{}         `yaml:"configuration,omitempty"`
	Hosts          []Host              `yaml:"hosts,omitempty"`
	Labels         map[string][]string `yaml:"labels,omitempty"`
}

Inventory contains the hosts and labels as parsed from YML

func (*Inventory) ToInventory

func (i *Inventory) ToInventory() ([]*server.Host, error)

ToInventory converts the YAML inventory to a host array

type SSH

type SSH struct {
	Hostname string `yaml:"hostname"`
	Network  string `yaml:"network"`
	Port     int    `yaml:"port,omitempty"`
	User     string `yaml:"user,omitempty"`
	Password string `yaml:"password,omitempty"`
	Become   string `yaml:"become,omitempty"`
}

SSH specifics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL