ansible

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NavigatorProgram    = "ansible-navigator"
	PlaybookProgram     = "ansible-playbook"
	ContainerEngineAuto = "auto"
)
View Source
const (
	SSHKnownHostsFileVar = "ansible_ssh_known_hosts_file"
)

Variables

View Source
var (
	ErrDirectory               = errors.New("directory is not valid")
	ErrContainerEngineValidate = errors.New("container engine is not valid")
	ErrContainerEnginePath     = errors.New("container engine must exist in PATH")
	ErrContainerEngineRunning  = errors.New("container engine is not running or usable")
	ErrNavigatorAbsPath        = fmt.Errorf("absolute path of %s cannot be represented", NavigatorProgram)
	ErrNavigatorPath           = fmt.Errorf("%s does not exist in PATH", NavigatorProgram)
	ErrNavigator               = fmt.Errorf("%s is not functional", NavigatorProgram)
	ErrPlaybookPath            = fmt.Errorf("%s does not exist in PATH", PlaybookProgram)
	ErrPlaybook                = fmt.Errorf("%s is not functional", PlaybookProgram)
)

Functions

func ContainerEngineOptions

func ContainerEngineOptions(auto bool) []string

func ContainerEnginePreflight

func ContainerEnginePreflight(containerEngine string) error

func CreateInventoryFile

func CreateInventoryFile(dir string, inventoryContents string) error

func CreateKnownHosts added in v0.16.0

func CreateKnownHosts(dir string, knownHosts []KnownHost, settings *NavigatorSettings) error

func CreateNavigatorSettingsFile

func CreateNavigatorSettingsFile(dir string, settingsContents string) error

func CreatePlaybookFile

func CreatePlaybookFile(dir string, playbookContents string) error

func CreatePrivateKeys added in v0.7.0

func CreatePrivateKeys(dir string, keys []PrivateKey, settings *NavigatorSettings) error

func CreateRunDir added in v0.2.0

func CreateRunDir(dir string) error

func DirectoryPreflight added in v0.1.1

func DirectoryPreflight(dir string) error

func ExecNavigatorRunCommand

func ExecNavigatorRunCommand(command *exec.Cmd) (string, error)

func GenerateNavigatorRunCommand

func GenerateNavigatorRunCommand(runDir string, workingDir string, ansibleNavigatorBinary string, eeEnabled bool, options *Options) *exec.Cmd

func GenerateNavigatorSettings

func GenerateNavigatorSettings(settings *NavigatorSettings) (string, error)

func GetStatusFromPlaybookArtifact added in v0.5.0

func GetStatusFromPlaybookArtifact(dir string) (string, error)

func GetStdoutFromPlaybookArtifact added in v0.5.0

func GetStdoutFromPlaybookArtifact(dir string) (string, error)
func NavigatorPathPreflight(path string) (string, error)
func NavigatorPreflight(binary string) error

TODO include output in error TODO require a min version

func PlaybookPreflight added in v0.14.0

func PlaybookPreflight() error

TODO include output in error TODO require a min version

func PullPolicyOptions

func PullPolicyOptions() []string

func QueryPlaybookArtifact

func QueryPlaybookArtifact(dir string, queries map[string]ArtifactQuery) error

func RemoveRunDir added in v0.2.0

func RemoveRunDir(dir string) error

func ValidateJQFilter added in v0.18.0

func ValidateJQFilter(filter string) error

Types

type ArtifactQuery

type ArtifactQuery struct {
	JQFilter string
	Results  []string
}

type KnownHost added in v0.16.0

type KnownHost = string

func GetKnownHosts added in v0.19.0

func GetKnownHosts(dir string) ([]KnownHost, error)
type NavigatorSettings struct {
	Timeout                  time.Duration
	EEEnabled                bool
	ContainerEngine          string
	EnvironmentVariablesPass []string
	EnvironmentVariablesSet  map[string]string
	Image                    string
	PullArguments            []string
	PullPolicy               string
	VolumeMounts             map[string]string
	ContainerOptions         []string
	Timezone                 string
}

type Options added in v0.12.0

type Options struct {
	ForceHandlers bool
	SkipTags      []string
	StartAtTask   string
	Limit         []string
	Tags          []string
	PrivateKeys   []string
	KnownHosts    bool
}

type PlaybookArtifact added in v0.5.0

type PlaybookArtifact struct {
	Status string   `json:"status"`
	Stdout []string `json:"stdout"`
}

type PrivateKey added in v0.7.0

type PrivateKey struct {
	Name string
	Data string
}

Jump to

Keyboard shortcuts

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