ansible

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const NavigatorProgram = "ansible-navigator"

Variables

View Source
var (
	ErrDirectory           = errors.New("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(dir string, inventoryContents string) error

func CreateNavigatorRunLogFile

func CreateNavigatorRunLogFile(dir string, outputContents string) error

func CreateNavigatorSettingsFile

func CreateNavigatorSettingsFile(dir string, settingsContents string) error

func CreatePlaybookFile

func CreatePlaybookFile(dir string, playbookContents string) error

func CreateRunDir added in v0.2.0

func CreateRunDir(dir string) error

func CreateRunSSHPrivateKeysDir added in v0.2.0

func CreateRunSSHPrivateKeysDir(dir string) error

func CreateSSHPrivateKeys added in v0.2.0

func CreateSSHPrivateKeys(dir string, keys []SSHPrivateKey, settings *NavigatorSettings, opts *RunOptions) 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(ctx context.Context, workingDirectory string, ansibleNavigatorBinary string, runDir 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(dir string, queries map[string]ArtifactQuery) error

func RemoveRunDir added in v0.2.0

func RemoveRunDir(dir string) error

Types

type ArtifactQuery

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

type RunOptions

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

type SSHPrivateKey added in v0.2.0

type SSHPrivateKey struct {
	Name string
	Data string
}

Jump to

Keyboard shortcuts

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