ansible

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const NavigatorProgram = "ansible-navigator"

Variables

View Source
var (
	ErrWorkingDirectory    = errors.New("working directory is not valid")
	ErrContainerEnginePath = errors.New("container engine (podman or docker) must exist in PATH")
	ErrContainerEngine     = errors.New("container engine is not running or usable")
	ErrNavigatorPath       = fmt.Errorf("%s does not exist in PATH", NavigatorProgram)
	ErrNavigator           = fmt.Errorf("%s is not functional", NavigatorProgram)
)

Functions

func ContainerEngineOptions

func ContainerEngineOptions() []string

func ContainerEnginePreflight

func ContainerEnginePreflight(containerEngine string) error

func CreateInventoryFile

func CreateInventoryFile(tempRunDir string, inventoryContents string) error

func CreateNavigatorRunLogFile

func CreateNavigatorRunLogFile(tempRunDir string, outputContents string) error

func CreateNavigatorSettingsFile

func CreateNavigatorSettingsFile(tempRunDir string, settingsContents string) error

func CreatePlaybookFile

func CreatePlaybookFile(tempRunDir string, playbookContents string) error

func CreateTempRunDir

func CreateTempRunDir(baseRunDir string, pattern string) (string, error)

func ExecNavigatorRunCommand

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

func GenerateNavigatorRunCommand

func GenerateNavigatorRunCommand(ctx context.Context, workingDirectory string, ansibleNavigatorBinary string, tempRunDir string, opts *RunOptions) *exec.Cmd

func GenerateNavigatorSettings

func GenerateNavigatorSettings(settings *NavigatorSettings) (string, error)
func NavigatorPath() (string, error)
func NavigatorPreflight(binary string) error

TODO include output in error TODO require a min version

func PullPolicyOptions

func PullPolicyOptions() []string

func QueryPlaybookArtifact

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

func RemoveTempRunDir

func RemoveTempRunDir(tempRunDir string) error

func WorkingDirectoryPreflight

func WorkingDirectoryPreflight(dir string) error

Types

type ArtifactQuery

type ArtifactQuery struct {
	JSONPath   string
	JSONOutput bool
	Result     string
}
type NavigatorSettings struct {
	ContainerEngine          string
	EnvironmentVariablesPass []string
	EnvironmentVariablesSet  map[string]string
	Image                    string
	PullArguments            []string
	PullPolicy               string
}

type RunOptions

type RunOptions struct {
	ForceHandlers bool
	Limit         []string
	Tags          []string
}

Jump to

Keyboard shortcuts

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