inventory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2015 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package inventory contains types and functions to manage an Ansible inventory (the bits that roster uses, for now).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortInventory

func SortInventory(i *Inventory)

SortInventory sorts any slice elements (e.g. the Hosts element of the Groups). Useful for testing comparisons using reflect.DeepEqual, possibly other places so put it here instead of inventory_test.go

Types

type Group

type Group struct{ Hosts []string }

A group is struct that contains a list of hosts.

type Groups

type Groups map[string]Group

Groups is a map of groups, keyed by a group name.

type HostVar

type HostVar map[string]string

HostVar is a map of variable names to variable values.

type HostVars

type HostVars map[string]HostVar

Hostvars is a map of HostVar, keyed by a hostname.

type Inventory

type Inventory struct {
	HostVars HostVars
	Groups   Groups
}

An Ansible Inventory consists of host variables and groups.

func NewFromJSON

func NewFromJSON(j string) (*Inventory, error)

NewFromJSON returns a *Inventory built from an Ansible dynamic inventory JSON string.

Jump to

Keyboard shortcuts

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