ansible

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type All

type All struct {
	Children map[string]HostGroup `yaml:"children"`
}

type AnsibleHost

type AnsibleHost struct {
	PrivateIP string            `yaml:"private_ip"`
	PublicIP  string            `yaml:"public_ip"`
	HostName  string            `yaml:"host_name"`
	ID        string            `yaml:"id"`
	Mounts    []Mount           `yaml:"mounts"`
	ExtraVars map[string]string `yaml:"extra_vars"`
}

type Client

type Client interface {
	Run(playbookFile, varFile string) error
}

func NewClient

func NewClient(inventory, user string) Client

type Host

type Host struct {
	Group     string `json:"group"`
	Host      string `json:"host"`
	HostName  string `json:"host_name"`
	PrivateIP string `json:"private_ip"`
	ServerID  string `json:"server_id"`
	Image     string `json:"image"`
}

type HostGroup

type HostGroup struct {
	Hosts map[string]AnsibleHost `yaml:"hosts"`
}

func (*HostGroup) GetHosts

func (group *HostGroup) GetHosts() []string

func (*HostGroup) GetPrivateHostNames

func (group *HostGroup) GetPrivateHostNames() []string

func (*HostGroup) GetPrivateHosts

func (group *HostGroup) GetPrivateHosts() []string

type HostValues

type HostValues struct {
	Value []Host `json:"value"`
}

type Inventory

type Inventory struct {
	Path string `yaml:"-"`
	All  All    `yaml:"all"`
}

func GenerateInventory

func GenerateInventory(config *conf.Config) (*Inventory, error)

func LoadInventory

func LoadInventory(file string) (*Inventory, error)

func (*Inventory) GetAllPrivateHosts

func (inv *Inventory) GetAllPrivateHosts() []string

type InventoryJson

type InventoryJson struct {
	Servers HostValues `json:"servers"`
	Volumes Volumes    `json:"volumes"`
}

type Mount

type Mount struct {
	Name      string `yaml:"name"`
	Path      string `yaml:"path"`
	MountPath string `yaml:"mount_path"`
	Owner     string `yaml:"owner"`
}

type Volume

type Volume struct {
	Mount    string `json:"mount"`
	Name     string `json:"name"`
	Path     string `json:"path"`
	ServerID int    `json:"server_id"`
}

type Volumes

type Volumes struct {
	Value []Volume `json:"value"`
}

Jump to

Keyboard shortcuts

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