ansible

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunModule

func RunModule(m Module, flags *pflag.FlagSet)

RunModule executes the module

Types

type Inventory

type Inventory struct {
	// contains filtered or unexported fields
}

Inventory represents a Ansible Inventory

func NewInventory

func NewInventory() Inventory

NewInventory creates a new empty Inventory

func (Inventory) AddGroup

func (i Inventory) AddGroup(group InventoryGroup)

AddGroup adds a group to the inventory

func (Inventory) AddHost

func (i Inventory) AddHost(host InventoryHost)

AddHost adds the host to the inventory

func (Inventory) MarshalJSON

func (i Inventory) MarshalJSON() ([]byte, error)

MarshalJSON converts this object into the ansible format

type InventoryGroup

type InventoryGroup struct {
	Name     string
	Vars     map[string]interface{}
	Children []string
}

InventoryGroup represents a Group in an Ansible Inventory

type InventoryHost

type InventoryHost struct {
	Host   string
	Groups []string
	Vars   map[string]interface{}
}

InventoryHost represents a Host in an Ansible Inventory

type MessageLog

type MessageLog struct {
	// contains filtered or unexported fields
}

MessageLog holds messages during module run

func (*MessageLog) Add

func (l *MessageLog) Add(msg string)

Add appends a message to the log

func (*MessageLog) String

func (l *MessageLog) String() string

type Module

type Module interface {
	Args() interface{}
	Run() (ModuleResponse, error)
}

Module interface for Ansible modules

type ModuleResponse

type ModuleResponse struct {
	// contains filtered or unexported fields
}

ModuleResponse represents the reponse of the module

func (*ModuleResponse) Changed

func (r *ModuleResponse) Changed() *ModuleResponse

Changed marks the the module as changed

func (*ModuleResponse) Data added in v0.2.0

func (r *ModuleResponse) Data() map[string]interface{}

Data returns the data of the response

func (*ModuleResponse) Failed

func (r *ModuleResponse) Failed() *ModuleResponse

Failed marks the module as failed

func (*ModuleResponse) HasChanged added in v0.2.0

func (r *ModuleResponse) HasChanged() bool

HasChanged returns true if the module has changed

func (*ModuleResponse) HasFailed added in v0.2.0

func (r *ModuleResponse) HasFailed() bool

HasFailed returns true if the module has failed

func (*ModuleResponse) MarshalJSON

func (r *ModuleResponse) MarshalJSON() ([]byte, error)

MarshalJSON custom json marshalling

func (*ModuleResponse) Msg

func (r *ModuleResponse) Msg(msg string) *ModuleResponse

Msg sets the module message

func (*ModuleResponse) Set

func (r *ModuleResponse) Set(key string, value interface{}) *ModuleResponse

Set adds data to the reponse

Jump to

Keyboard shortcuts

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