modules

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPythonFallbackForCompilation added in v1.0.0

func GetPythonFallbackForCompilation(moduleName string, rawParams interface{}) (pkg.Module, interface{})

GetPythonFallbackForCompilation creates a Python fallback module and params for compilation phase

func GetPythonFallbackModule added in v1.0.0

func GetPythonFallbackModule(moduleName string, originalParams pkg.ConcreteModuleInputProvider) (pkg.Module, pkg.ConcreteModuleInputProvider, error)

GetPythonFallbackModule creates a Python fallback module for unknown modules

func IsPackageInstalled

func IsPackageInstalled(packageName string, c *pkg.HostContext, runAs string) bool

Types

type AnsiblePythonInput added in v1.0.0

type AnsiblePythonInput struct {
	ModuleName string      `yaml:"module_name" json:"module_name"`
	Args       interface{} `yaml:"args" json:"args"`
}

AnsiblePythonInput defines parameters for executing Python Ansible modules

func (AnsiblePythonInput) GetVariableUsage added in v1.0.0

func (i AnsiblePythonInput) GetVariableUsage() []string

func (AnsiblePythonInput) HasRevert added in v1.0.0

func (i AnsiblePythonInput) HasRevert() bool

func (AnsiblePythonInput) ProvidesVariables added in v1.0.0

func (i AnsiblePythonInput) ProvidesVariables() []string

func (AnsiblePythonInput) ToCode added in v1.0.0

func (i AnsiblePythonInput) ToCode() string

func (AnsiblePythonInput) Validate added in v1.0.0

func (i AnsiblePythonInput) Validate() error

type AnsiblePythonModule added in v1.0.0

type AnsiblePythonModule struct {
	ModuleName string
}

AnsiblePythonModule implements a fallback module that executes Ansible modules via Python

func (AnsiblePythonModule) Doc added in v1.0.0

func (m AnsiblePythonModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (AnsiblePythonModule) Execute added in v1.0.0

func (AnsiblePythonModule) InputType added in v1.0.0

func (m AnsiblePythonModule) InputType() reflect.Type

func (AnsiblePythonModule) OutputType added in v1.0.0

func (m AnsiblePythonModule) OutputType() reflect.Type

func (AnsiblePythonModule) ParameterAliases added in v1.0.0

func (m AnsiblePythonModule) ParameterAliases() map[string]string

func (AnsiblePythonModule) ParameterDocs added in v1.0.0

func (m AnsiblePythonModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for ansible_python module inputs.

func (AnsiblePythonModule) Revert added in v1.0.0

type AnsiblePythonOutput added in v1.0.0

type AnsiblePythonOutput struct {
	WasChanged bool                   `yaml:"changed" json:"changed"`
	Failed     bool                   `yaml:"failed" json:"failed"`
	Msg        string                 `yaml:"msg" json:"msg"`
	Results    map[string]interface{} `yaml:"results" json:"results"`
	pkg.ModuleOutput
}

AnsiblePythonOutput defines the output from a Python Ansible module execution

func (AnsiblePythonOutput) AsFacts added in v1.0.0

func (o AnsiblePythonOutput) AsFacts() map[string]interface{}

AsFacts implements the pkg.FactProvider interface.

func (AnsiblePythonOutput) Changed added in v1.0.0

func (o AnsiblePythonOutput) Changed() bool

func (AnsiblePythonOutput) String added in v1.0.0

func (o AnsiblePythonOutput) String() string

type AptInput

type AptInput struct {
	Name        interface{} `yaml:"name"`         // Name of the package(s) (string or list of strings)
	State       string      `yaml:"state"`        // present (default), absent, latest
	UpdateCache bool        `yaml:"update_cache"` // Run apt-get update before action
	// Internal storage for parsed package list
	PkgNames []string
}

AptInput defines the parameters for the apt module.

func (*AptInput) GetVariableUsage

func (i *AptInput) GetVariableUsage() []string

GetVariableUsage identifies variables used in the apt parameters.

func (*AptInput) HasRevert

func (i *AptInput) HasRevert() bool

HasRevert indicates if the action can be reverted.

func (*AptInput) ProvidesVariables

func (i *AptInput) ProvidesVariables() []string

func (*AptInput) ToCode

func (i *AptInput) ToCode() string

ToCode converts the AptInput struct into its Go code representation.

func (*AptInput) UnmarshalYAML

func (i *AptInput) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML handles shorthand and list formats for the apt module 'name'.

func (*AptInput) Validate

func (i *AptInput) Validate() error

Validate checks if the input parameters are valid.

type AptModule

type AptModule struct{}

AptModule implements the Ansible 'apt' module logic.

func (AptModule) Doc added in v1.0.0

func (am AptModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (AptModule) Execute

func (m AptModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

Execute runs the apt module logic.

func (AptModule) InputType

func (am AptModule) InputType() reflect.Type

func (AptModule) OutputType

func (am AptModule) OutputType() reflect.Type

func (AptModule) ParameterAliases

func (m AptModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (AptModule) ParameterDocs added in v1.0.0

func (m AptModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for apt module inputs.

func (AptModule) Revert

func (m AptModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

Revert attempts to undo the action performed by Execute.

type AptOutput

type AptOutput struct {
	Packages    []string `yaml:"packages"` // Packages operated on
	Versions    []string `yaml:"versions"` // Versions installed/removed (if applicable)
	State       string   `yaml:"state"`    // Final state (installed, removed, updated)
	WasChanged  bool     // Internal flag to track if apt made changes
	UpdateCache bool     // Whether cache update was performed
	pkg.ModuleOutput
}

AptOutput defines the output of the apt module.

func (AptOutput) AsFacts

func (o AptOutput) AsFacts() map[string]interface{}

AsFacts implements the pkg.FactProvider interface.

func (AptOutput) Changed

func (o AptOutput) Changed() bool

Changed indicates if the apt module made changes to the system.

func (AptOutput) String

func (o AptOutput) String() string

String provides a string representation of the AptOutput.

type AssertInput

type AssertInput struct {
	That []string `yaml:"that"` // List of assertions to evaluate
	Msg  string   `yaml:"msg"`  // Optional message on failure
}

func (AssertInput) GetVariableUsage

func (i AssertInput) GetVariableUsage() []string

func (AssertInput) HasRevert

func (i AssertInput) HasRevert() bool

HasRevert indicates that the assert module cannot be reverted.

func (AssertInput) ProvidesVariables

func (i AssertInput) ProvidesVariables() []string

func (AssertInput) ToCode

func (i AssertInput) ToCode() string

func (AssertInput) Validate

func (i AssertInput) Validate() error

type AssertModule

type AssertModule struct{}

func (AssertModule) Doc added in v1.0.0

func (am AssertModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (AssertModule) Execute

func (m AssertModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (AssertModule) InputType

func (am AssertModule) InputType() reflect.Type

func (AssertModule) OutputType

func (am AssertModule) OutputType() reflect.Type

func (AssertModule) ParameterAliases

func (m AssertModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (AssertModule) ParameterDocs added in v1.0.0

func (am AssertModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for assert module inputs.

func (AssertModule) Revert

func (m AssertModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

Revert for Assert is a no-op as it doesn't change state

type AssertOutput

type AssertOutput struct {
	FailedAssertion string // Which assertion failed, if any
	pkg.ModuleOutput
}

func (AssertOutput) Changed

func (o AssertOutput) Changed() bool

func (AssertOutput) String

func (o AssertOutput) String() string

type BlockInput added in v1.0.0

type BlockInput struct {
}

func (BlockInput) GetVariableUsage added in v1.0.0

func (i BlockInput) GetVariableUsage() []string

func (BlockInput) HasRevert added in v1.0.0

func (i BlockInput) HasRevert() bool

func (BlockInput) ProvidesVariables added in v1.0.0

func (i BlockInput) ProvidesVariables() []string

func (BlockInput) ToCode added in v1.0.0

func (i BlockInput) ToCode() string

func (BlockInput) UnmarshalYAML added in v1.0.0

func (i BlockInput) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML unpacks the block input into the BlockInput struct. This is necessary to store the list of nodes into Children.

func (BlockInput) Validate added in v1.0.0

func (i BlockInput) Validate() error

type BlockModule added in v1.0.0

type BlockModule struct{}

func (BlockModule) Doc added in v1.0.0

func (m BlockModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (BlockModule) EvaluateExecute added in v1.0.0

func (m BlockModule) EvaluateExecute(metatask *pkg.MetaTask, closure *pkg.Closure) chan pkg.TaskResult

func (BlockModule) EvaluateRevert added in v1.0.0

func (m BlockModule) EvaluateRevert(metatask *pkg.MetaTask, closure *pkg.Closure) chan pkg.TaskResult

func (BlockModule) InputType added in v1.0.0

func (m BlockModule) InputType() reflect.Type

func (BlockModule) OutputType added in v1.0.0

func (m BlockModule) OutputType() reflect.Type

func (BlockModule) ParameterAliases added in v1.0.0

func (m BlockModule) ParameterAliases() map[string]string

func (BlockModule) ParameterDocs added in v1.0.0

func (m BlockModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for block module inputs.

type BlockOutput added in v1.0.0

type BlockOutput struct {
	pkg.ModuleOutput
}

func (BlockOutput) String added in v1.0.0

func (b BlockOutput) String() string

type CommandInput

type CommandInput struct {
	Execute string `yaml:"execute"` // The command to execute. Aliased as 'cmd'.
	Revert  string `yaml:"revert"`  // The command to execute for reverting changes.
}

CommandInput defines the parameters for the command module.

func (CommandInput) GetVariableUsage

func (i CommandInput) GetVariableUsage() []string

GetVariableUsage identifies variables used in the execute and revert commands.

func (CommandInput) HasRevert

func (i CommandInput) HasRevert() bool

HasRevert checks if a revert command is defined.

func (CommandInput) ProvidesVariables

func (i CommandInput) ProvidesVariables() []string

func (CommandInput) ToCode

func (i CommandInput) ToCode() string

ToCode converts the CommandInput struct into its Go code representation.

func (*CommandInput) UnmarshalYAML

func (i *CommandInput) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML allows the command module value to be either a string (shorthand) or a map with 'execute' and optionally 'revert'.

func (CommandInput) Validate

func (i CommandInput) Validate() error

Validate checks if the input parameters are valid.

type CommandModule

type CommandModule struct{}

CommandModule implements the Ansible 'command' module logic. It executes commands directly without going through a shell, meaning variables like $HOME and operations like "<", ">", "|", ";", "&" will not work.

func (CommandModule) Doc added in v1.0.0

func (cm CommandModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (CommandModule) Execute

func (cm CommandModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

Execute runs the main command.

func (CommandModule) InputType

func (cm CommandModule) InputType() reflect.Type

func (CommandModule) OutputType

func (cm CommandModule) OutputType() reflect.Type

func (CommandModule) ParameterAliases

func (m CommandModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (CommandModule) ParameterDocs added in v1.0.0

func (cm CommandModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for command module inputs.

func (CommandModule) Revert

func (cm CommandModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

Revert runs the revert command.

type CommandOutput

type CommandOutput struct {
	Stdout  string `yaml:"stdout"`
	Stderr  string `yaml:"stderr"`
	Command string `yaml:"command"` // The actual command executed after templating.
	Rc      int    `yaml:"rc"`
	pkg.ModuleOutput
}

CommandOutput defines the output of the command module.

func (CommandOutput) AsFacts

func (o CommandOutput) AsFacts() map[string]interface{}

AsFacts implements the pkg.FactProvider interface. It returns a map representation suitable for registration.

func (CommandOutput) Changed

func (o CommandOutput) Changed() bool

Changed indicates if the command potentially changed the system state. For the command module, we assume it always potentially changes state.

func (CommandOutput) String

func (o CommandOutput) String() string

String provides a string representation of the CommandOutput.

type CopyInput

type CopyInput struct {
	Content string `yaml:"content"`
	Src     string `yaml:"src"`
	Dst     string `yaml:"dest"`
	Mode    string `yaml:"mode"`
}

func (CopyInput) GetVariableUsage

func (i CopyInput) GetVariableUsage() []string

func (CopyInput) HasRevert

func (i CopyInput) HasRevert() bool

HasRevert indicates that the copy module can be reverted.

func (CopyInput) ProvidesVariables

func (i CopyInput) ProvidesVariables() []string

func (CopyInput) ToCode

func (i CopyInput) ToCode() string

func (CopyInput) Validate

func (i CopyInput) Validate() error

type CopyModule

type CopyModule struct{}

func (CopyModule) Doc added in v1.0.0

func (cm CopyModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (CopyModule) Execute

func (m CopyModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (CopyModule) InputType

func (cm CopyModule) InputType() reflect.Type

func (CopyModule) OutputType

func (cm CopyModule) OutputType() reflect.Type

func (CopyModule) ParameterAliases

func (cm CopyModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (CopyModule) ParameterDocs added in v1.0.0

func (cm CopyModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for copy module inputs.

func (CopyModule) Revert

func (m CopyModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

type CopyOutput

type CopyOutput struct {
	Contents pkg.RevertableChange[string]
	Mode     pkg.RevertableChange[string]
	pkg.ModuleOutput
}

func (CopyOutput) Changed

func (o CopyOutput) Changed() bool

func (CopyOutput) String

func (o CopyOutput) String() string

type DebugInput

type DebugInput struct {
	Msg interface{} `yaml:"msg,omitempty"`
	Var string      `yaml:"var,omitempty"`
}

DebugInput defines the structure for the debug module's input. It can take a 'msg' to print directly, or a 'var' to print a variable's content.

func (DebugInput) GetVariableUsage

func (i DebugInput) GetVariableUsage() []string

GetVariableUsage extracts variables used within the 'msg' or 'var' fields.

func (DebugInput) HasRevert

func (i DebugInput) HasRevert() bool

HasRevert indicates that debug module does not have a revert action.

func (DebugInput) ProvidesVariables

func (i DebugInput) ProvidesVariables() []string

ProvidesVariables returns an empty list as debug doesn't set new variables.

func (DebugInput) ToCode

func (i DebugInput) ToCode() string

ToCode generates Go code representation of the DebugInput.

func (*DebugInput) UnmarshalYAML

func (i *DebugInput) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML custom unmarshaler to handle parameters.

func (DebugInput) Validate

func (i DebugInput) Validate() error

Validate ensures that either 'msg' or 'var' is provided.

type DebugModule

type DebugModule struct{}

DebugModule implements the logic for the debug module.

func (DebugModule) Doc added in v1.0.0

func (m DebugModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (DebugModule) Execute

func (m DebugModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

Execute prints the message or variable content.

func (DebugModule) InputType

func (m DebugModule) InputType() reflect.Type

func (DebugModule) OutputType

func (m DebugModule) OutputType() reflect.Type

func (DebugModule) ParameterAliases

func (m DebugModule) ParameterAliases() map[string]string

ParameterAliases defines aliases if needed.

func (DebugModule) ParameterDocs added in v1.0.0

func (m DebugModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for debug module inputs.

func (DebugModule) Revert

func (m DebugModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

Revert for debug now mirrors Execute.

type DebugOutput

type DebugOutput struct {
	MessagePrinted string
}

DebugOutput provides information about what was printed.

func (DebugOutput) Changed

func (o DebugOutput) Changed() bool

Changed indicates that the debug module does not change state.

func (DebugOutput) String

func (o DebugOutput) String() string

String provides a human-readable summary of the output.

type FailInput

type FailInput struct {
	Msg string `yaml:"msg"`
}

FailInput defines the structure for the fail module's input. It takes a 'msg' to be used as the failure message.

func (FailInput) GetVariableUsage

func (i FailInput) GetVariableUsage() []string

GetVariableUsage extracts variables used within the 'msg' field.

func (FailInput) HasRevert

func (i FailInput) HasRevert() bool

HasRevert indicates that fail module does not have a specific revert action. The failure itself might trigger a broader revert of previous tasks.

func (FailInput) ProvidesVariables

func (i FailInput) ProvidesVariables() []string

ProvidesVariables returns an empty list as fail doesn't set new variables.

func (FailInput) ToCode

func (i FailInput) ToCode() string

ToCode generates Go code representation of the FailInput.

func (FailInput) Validate

func (i FailInput) Validate() error

Validate ensures that 'msg' is provided.

type FailModule

type FailModule struct{}

FailModule implements the logic for the fail module.

func (FailModule) Doc added in v1.0.0

func (m FailModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (FailModule) Execute

func (m FailModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

Execute always returns an error with the provided message.

func (FailModule) InputType

func (m FailModule) InputType() reflect.Type

func (FailModule) OutputType

func (m FailModule) OutputType() reflect.Type

func (FailModule) ParameterAliases

func (m FailModule) ParameterAliases() map[string]string

ParameterAliases defines aliases if needed.

func (FailModule) ParameterDocs added in v1.0.0

func (m FailModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for fail module inputs.

func (FailModule) Revert

func (m FailModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

Revert for fail is a no-op. The failure itself is the primary action.

type FailOutput

type FailOutput struct {
	FailedMessage string
}

FailOutput provides information about the failure.

func (FailOutput) Changed

func (o FailOutput) Changed() bool

Changed indicates that the fail module does not change state.

func (FailOutput) String

func (o FailOutput) String() string

String provides a human-readable summary of the output.

type FileInput

type FileInput struct {
	Path  string `yaml:"path"` // Destination path
	State string `yaml:"state"`
	Mode  string `yaml:"mode"`
	Src   string `yaml:"src,omitempty"` // Source path for state=link
}

func (FileInput) GetVariableUsage

func (i FileInput) GetVariableUsage() []string

func (FileInput) HasRevert

func (i FileInput) HasRevert() bool

func (FileInput) ProvidesVariables

func (i FileInput) ProvidesVariables() []string

func (FileInput) ToCode

func (i FileInput) ToCode() string

func (FileInput) Validate

func (i FileInput) Validate() error

type FileModule

type FileModule struct{}

func (FileModule) Doc added in v1.0.0

func (fm FileModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (FileModule) Execute

func (m FileModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (FileModule) InputType

func (fm FileModule) InputType() reflect.Type

func (FileModule) OutputType

func (fm FileModule) OutputType() reflect.Type

func (FileModule) ParameterAliases

func (fm FileModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for the file module parameters.

func (FileModule) ParameterDocs added in v1.0.0

func (fm FileModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for file module inputs.

func (FileModule) Revert

func (m FileModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

type FileOutput

type FileOutput struct {
	State      pkg.RevertableChange[string] // "file", "directory", "link", "absent"
	Mode       pkg.RevertableChange[string] // Octal mode string
	Exists     pkg.RevertableChange[bool]
	IsLnk      pkg.RevertableChange[bool]   // Whether the path is a symlink
	LinkTarget pkg.RevertableChange[string] // Target of the symlink, if IsLnk is true
	pkg.ModuleOutput
}

func (FileOutput) Changed

func (o FileOutput) Changed() bool

func (FileOutput) String

func (o FileOutput) String() string

type GitInput

type GitInput struct {
	Repo    string `yaml:"repo"`
	Dest    string `yaml:"dest"`
	Version string `yaml:"version"`
}

func (GitInput) GetVariableUsage

func (i GitInput) GetVariableUsage() []string

func (GitInput) HasRevert

func (i GitInput) HasRevert() bool

func (GitInput) ProvidesVariables

func (i GitInput) ProvidesVariables() []string

func (GitInput) ToCode

func (i GitInput) ToCode() string

func (GitInput) Validate

func (i GitInput) Validate() error

type GitModule

type GitModule struct{}

func (GitModule) CheckoutVersion

func (m GitModule) CheckoutVersion(dest, version string, c *pkg.HostContext, runAs string) (string, error)

func (GitModule) CloneRepo

func (m GitModule) CloneRepo(repo, dest string, c *pkg.HostContext, runAs string) error

func (GitModule) Doc added in v1.0.0

func (sm GitModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (GitModule) Execute

func (m GitModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (GitModule) GetCurrentRev

func (m GitModule) GetCurrentRev(dest string, c *pkg.HostContext, runAs string) (string, error)

func (GitModule) InputType

func (sm GitModule) InputType() reflect.Type

func (GitModule) OutputType

func (sm GitModule) OutputType() reflect.Type

func (GitModule) ParameterAliases

func (m GitModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (GitModule) ParameterDocs added in v1.0.0

func (sm GitModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for git module inputs.

func (GitModule) Revert

func (m GitModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

type GitOutput

type GitOutput struct {
	Rev  pkg.RevertableChange[string]
	Dest string
	pkg.ModuleOutput
}

func (GitOutput) Changed

func (o GitOutput) Changed() bool

func (GitOutput) String

func (o GitOutput) String() string

type IncludeInput

type IncludeInput struct {
	Path string `yaml:"path"`
}

IncludeInput defines the structure for the 'include' directive parameters. It's used during preprocessing, not as a runtime module.

func (IncludeInput) GetVariableUsage

func (i IncludeInput) GetVariableUsage() []string

GetVariableUsage identifies variables used in the path, potentially for future templating.

func (IncludeInput) InputType

func (i IncludeInput) InputType() reflect.Type

InputType returns the type of IncludeInput, used for parsing.

func (IncludeInput) Validate

func (i IncludeInput) Validate() error

Validate checks if the required 'path' parameter is present.

type IncludeRoleInput

type IncludeRoleInput struct {
	Name string `yaml:"name"`
}

func (IncludeRoleInput) GetVariableUsage

func (i IncludeRoleInput) GetVariableUsage() []string

func (IncludeRoleInput) HasRevert added in v1.0.0

func (i IncludeRoleInput) HasRevert() bool

func (IncludeRoleInput) ProvidesVariables added in v1.0.0

func (i IncludeRoleInput) ProvidesVariables() []string

func (IncludeRoleInput) ToCode added in v1.0.0

func (i IncludeRoleInput) ToCode() string

func (IncludeRoleInput) Validate

func (i IncludeRoleInput) Validate() error

type IncludeRoleModule added in v1.0.0

type IncludeRoleModule struct{}

func (IncludeRoleModule) Doc added in v1.0.0

func (m IncludeRoleModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (IncludeRoleModule) EvaluateExecute added in v1.0.0

func (m IncludeRoleModule) EvaluateExecute(metatask *pkg.MetaTask, closure *pkg.Closure) chan pkg.TaskResult

func (IncludeRoleModule) EvaluateRevert added in v1.0.0

func (m IncludeRoleModule) EvaluateRevert(metatask *pkg.MetaTask, closure *pkg.Closure) chan pkg.TaskResult

func (IncludeRoleModule) InputType added in v1.0.0

func (m IncludeRoleModule) InputType() reflect.Type

func (IncludeRoleModule) OutputType added in v1.0.0

func (m IncludeRoleModule) OutputType() reflect.Type

func (IncludeRoleModule) ParameterAliases added in v1.0.0

func (m IncludeRoleModule) ParameterAliases() map[string]string

func (IncludeRoleModule) ParameterDocs added in v1.0.0

func (m IncludeRoleModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for include_role module inputs.

type IncludeRoleOutput added in v1.0.0

type IncludeRoleOutput struct{ pkg.ModuleOutput }

func (IncludeRoleOutput) String added in v1.0.0

func (o IncludeRoleOutput) String() string

type IncludeTasksInput added in v1.0.0

type IncludeTasksInput struct{}

func (IncludeTasksInput) GetVariableUsage added in v1.0.0

func (i IncludeTasksInput) GetVariableUsage() []string

func (IncludeTasksInput) HasRevert added in v1.0.0

func (i IncludeTasksInput) HasRevert() bool

func (IncludeTasksInput) ProvidesVariables added in v1.0.0

func (i IncludeTasksInput) ProvidesVariables() []string

func (IncludeTasksInput) ToCode added in v1.0.0

func (i IncludeTasksInput) ToCode() string

func (IncludeTasksInput) Validate added in v1.0.0

func (i IncludeTasksInput) Validate() error

type IncludeTasksModule added in v1.0.0

type IncludeTasksModule struct{}

func (IncludeTasksModule) Doc added in v1.0.0

func (m IncludeTasksModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (IncludeTasksModule) EvaluateExecute added in v1.0.0

func (m IncludeTasksModule) EvaluateExecute(metatask *pkg.MetaTask, closure *pkg.Closure) chan pkg.TaskResult

func (IncludeTasksModule) EvaluateRevert added in v1.0.0

func (m IncludeTasksModule) EvaluateRevert(metatask *pkg.MetaTask, closure *pkg.Closure) chan pkg.TaskResult

func (IncludeTasksModule) InputType added in v1.0.0

func (m IncludeTasksModule) InputType() reflect.Type

func (IncludeTasksModule) OutputType added in v1.0.0

func (m IncludeTasksModule) OutputType() reflect.Type

func (IncludeTasksModule) ParameterAliases added in v1.0.0

func (m IncludeTasksModule) ParameterAliases() map[string]string

func (IncludeTasksModule) ParameterDocs added in v1.0.0

func (m IncludeTasksModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for include_tasks module inputs.

type IncludeTasksOutput added in v1.0.0

type IncludeTasksOutput struct{ pkg.ModuleOutput }

func (IncludeTasksOutput) String added in v1.0.0

func (o IncludeTasksOutput) String() string

type LineinfileInput

type LineinfileInput struct {
	Path         string `yaml:"path"` // Aliases: dest, destfile, name
	Line         string `yaml:"line"`
	Regexp       string `yaml:"regexp"`
	State        string `yaml:"state,omitempty"`        // "present" or "absent", defaults to "present"
	Backrefs     bool   `yaml:"backrefs,omitempty"`     // Use backreferences from regexp in line
	Create       bool   `yaml:"create,omitempty"`       // Create the file if it doesn't exist
	InsertAfter  string `yaml:"insertafter,omitempty"`  // Regex, or "EOF"
	InsertBefore string `yaml:"insertbefore,omitempty"` // Regex, or "BOF"
	Mode         string `yaml:"mode,omitempty"`         // File mode if created
}

func (LineinfileInput) GetVariableUsage

func (i LineinfileInput) GetVariableUsage() []string

GetVariableUsage identifies variables used in templates.

func (LineinfileInput) HasRevert

func (i LineinfileInput) HasRevert() bool

HasRevert indicates that the lineinfile module can be reverted.

func (LineinfileInput) ProvidesVariables

func (i LineinfileInput) ProvidesVariables() []string

ProvidesVariables returns nil as lineinfile doesn't inherently define variables.

func (LineinfileInput) ToCode

func (i LineinfileInput) ToCode() string

ToCode generates the Go code representation of the input.

func (LineinfileInput) Validate

func (i LineinfileInput) Validate() error

Validate checks the input parameters for correctness.

type LineinfileModule

type LineinfileModule struct{}

func (LineinfileModule) Doc added in v1.0.0

func (lm LineinfileModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (LineinfileModule) Execute

func (lm LineinfileModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (LineinfileModule) InputType

func (lm LineinfileModule) InputType() reflect.Type

func (LineinfileModule) OutputType

func (lm LineinfileModule) OutputType() reflect.Type

func (LineinfileModule) ParameterAliases

func (lm LineinfileModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (LineinfileModule) ParameterDocs added in v1.0.0

func (lm LineinfileModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for lineinfile module inputs.

func (LineinfileModule) Revert

func (lm LineinfileModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previousOutput pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

type LineinfileOutput

type LineinfileOutput struct {
	Msg                string                       `yaml:"msg"`
	Diff               pkg.RevertableChange[string] `yaml:"-"` // Don't serialize diff in YAML
	OriginalFileExists bool                         `yaml:"-"`
	OriginalMode       string                       `yaml:"-"`
	ShouldShowDiff     bool                         `yaml:"-"` // New field to control diff display
	pkg.ModuleOutput
}

LineinfileOutput contains the result information for a lineinfile operation.

func (LineinfileOutput) Changed

func (o LineinfileOutput) Changed() bool

Changed indicates if the module made any changes.

func (LineinfileOutput) String

func (o LineinfileOutput) String() string

String provides a human-readable summary of the output.

type PacmanInput

type PacmanInput struct {
	Name  []string `yaml:"name"`
	State string   `yaml:"state"`
}

func (PacmanInput) GetVariableUsage

func (i PacmanInput) GetVariableUsage() []string

func (PacmanInput) HasRevert

func (i PacmanInput) HasRevert() bool

func (PacmanInput) ProvidesVariables

func (i PacmanInput) ProvidesVariables() []string

func (PacmanInput) ToCode

func (i PacmanInput) ToCode() string

func (PacmanInput) Validate

func (i PacmanInput) Validate() error

type PacmanModule

type PacmanModule struct{}

func (PacmanModule) Doc added in v1.0.0

func (sm PacmanModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (PacmanModule) Execute

func (m PacmanModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (PacmanModule) InputType

func (sm PacmanModule) InputType() reflect.Type

func (PacmanModule) InstallPackages

func (m PacmanModule) InstallPackages(packages []string, c *pkg.HostContext, runAs string) (PacmanOutput, error)

func (PacmanModule) IsPackageInstalled

func (m PacmanModule) IsPackageInstalled(packageName string, c *pkg.HostContext, runAs string) bool

func (PacmanModule) OutputType

func (sm PacmanModule) OutputType() reflect.Type

func (PacmanModule) ParameterAliases

func (m PacmanModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (PacmanModule) ParameterDocs added in v1.0.0

func (sm PacmanModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for pacman module inputs.

func (PacmanModule) RemovePackages

func (m PacmanModule) RemovePackages(packages []string, c *pkg.HostContext, runAs string) (PacmanOutput, error)

func (PacmanModule) Revert

func (m PacmanModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

type PacmanOutput

type PacmanOutput struct {
	Installed []string
	Removed   []string
	Stdout    string
	Stderr    string
	pkg.ModuleOutput
}

func (PacmanOutput) Changed

func (o PacmanOutput) Changed() bool

func (PacmanOutput) String

func (o PacmanOutput) String() string

type PythonFallbackModule added in v1.0.0

type PythonFallbackModule struct{}

PythonFallbackModule implements Module interface for Python fallback handling

func (PythonFallbackModule) Execute added in v1.0.0

func (PythonFallbackModule) InputType added in v1.0.0

func (m PythonFallbackModule) InputType() reflect.Type

func (PythonFallbackModule) OutputType added in v1.0.0

func (m PythonFallbackModule) OutputType() reflect.Type

func (PythonFallbackModule) ParameterAliases added in v1.0.0

func (m PythonFallbackModule) ParameterAliases() map[string]string

func (PythonFallbackModule) Revert added in v1.0.0

type SetFactInput

type SetFactInput struct {
	Facts map[string]interface{}
}

SetFactInput defines the structure for facts to be set. Using a map directly allows flexible key-value pairs.

func (SetFactInput) GetVariableUsage

func (i SetFactInput) GetVariableUsage() []string

GetVariableUsage extracts variables used within the fact values.

func (SetFactInput) HasRevert

func (i SetFactInput) HasRevert() bool

HasRevert indicates whether the input parameters define a revert action. For set_fact, revert is handled generically (no-op), so input doesn't define it.

func (SetFactInput) ProvidesVariables

func (i SetFactInput) ProvidesVariables() []string

ProvidesVariables returns the names of the facts being set.

func (SetFactInput) ToCode

func (i SetFactInput) ToCode() string

ToCode generates Go code representation of the SetFactInput.

func (*SetFactInput) UnmarshalYAML

func (i *SetFactInput) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML custom unmarshaler to handle direct map structure

func (SetFactInput) Validate

func (i SetFactInput) Validate() error

Validate ensures that there are facts to set.

type SetFactModule

type SetFactModule struct{}

SetFactModule implements the logic for setting facts.

func (SetFactModule) Doc added in v1.0.0

func (m SetFactModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (SetFactModule) Execute

func (m SetFactModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

Execute sets the facts in the host context.

func (SetFactModule) InputType

func (m SetFactModule) InputType() reflect.Type

func (SetFactModule) OutputType

func (m SetFactModule) OutputType() reflect.Type

func (SetFactModule) ParameterAliases

func (m SetFactModule) ParameterAliases() map[string]string

ParameterAliases defines aliases if needed.

func (SetFactModule) ParameterDocs added in v1.0.0

func (m SetFactModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for set_fact module inputs.

func (SetFactModule) Revert

func (m SetFactModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

Revert for set_fact is generally a no-op. Facts set are part of the context state. Undoing them would require tracking the previous state, which adds complexity. If a task fails, subsequent tasks won't see the facts set by the failed task anyway.

type SetFactOutput

type SetFactOutput struct {
	FactsSet map[string]interface{} // Record which facts were actually set/modified

}

SetFactOutput provides information about the facts that were set.

func (SetFactOutput) Changed

func (o SetFactOutput) Changed() bool

Changed indicates if any facts were added or modified.

func (SetFactOutput) MarshalJSON added in v1.0.0

func (o SetFactOutput) MarshalJSON() ([]byte, error)

MarshalJSON customizes JSON marshaling to embed facts directly at the top level

func (SetFactOutput) String

func (o SetFactOutput) String() string

String provides a human-readable summary of the output.

type SetupInput

type SetupInput struct {
	Facts []string `yaml:"facts"`
}

func (SetupInput) GetVariableUsage

func (i SetupInput) GetVariableUsage() []string

func (SetupInput) HasRevert

func (i SetupInput) HasRevert() bool

func (SetupInput) ProvidesVariables

func (i SetupInput) ProvidesVariables() []string

func (SetupInput) ToCode

func (i SetupInput) ToCode() string

func (SetupInput) Validate

func (i SetupInput) Validate() error

type SetupModule

type SetupModule struct{}

func (SetupModule) Doc added in v1.0.0

func (sm SetupModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (SetupModule) Execute

func (m SetupModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (SetupModule) InputType

func (sm SetupModule) InputType() reflect.Type

func (SetupModule) OutputType

func (sm SetupModule) OutputType() reflect.Type

func (SetupModule) ParameterAliases

func (m SetupModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (SetupModule) ParameterDocs added in v1.0.0

func (sm SetupModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for setup module inputs.

func (SetupModule) Revert

func (m SetupModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

type SetupOutput

type SetupOutput struct {
	Facts map[string]interface{}
	pkg.ModuleOutput
}

func (SetupOutput) Changed

func (o SetupOutput) Changed() bool

func (SetupOutput) String

func (o SetupOutput) String() string

type ShellInput

type ShellInput struct {
	Execute string `yaml:"execute"`
	Revert  string `yaml:"revert"`
}

func (ShellInput) GetVariableUsage

func (i ShellInput) GetVariableUsage() []string

func (ShellInput) HasRevert

func (i ShellInput) HasRevert() bool

HasRevert checks if a revert command is defined.

func (ShellInput) ProvidesVariables

func (i ShellInput) ProvidesVariables() []string

ProvidesVariables returns nil as shell input doesn't inherently define variables.

func (ShellInput) ToCode

func (i ShellInput) ToCode() string

func (*ShellInput) UnmarshalYAML

func (i *ShellInput) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface for ShellInput. This remains important as Task.UnmarshalYAML will delegate decoding of the params node to this method if the input type is ShellInput. It allows the shell module value to be either a string (shorthand for execute) or a map with 'execute' and optionally 'revert' keys.

func (ShellInput) Validate

func (i ShellInput) Validate() error

type ShellModule

type ShellModule struct{}

func (ShellModule) Doc added in v1.0.0

func (sm ShellModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (ShellModule) Execute

func (m ShellModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (ShellModule) InputType

func (sm ShellModule) InputType() reflect.Type

func (ShellModule) OutputType

func (sm ShellModule) OutputType() reflect.Type

func (ShellModule) ParameterAliases

func (m ShellModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (ShellModule) ParameterDocs added in v1.0.0

func (sm ShellModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for shell module inputs.

func (ShellModule) Revert

func (m ShellModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

type ShellOutput

type ShellOutput struct {
	Stdout      string   `yaml:"stdout"`
	Stderr      string   `yaml:"stderr"`
	Command     string   `yaml:"command"`
	StdoutLines []string `yaml:"stdout_lines"`
	StderrLines []string `yaml:"stderr_lines"`
	pkg.ModuleOutput
	Rc int `json:"rc"`
}

func (ShellOutput) AsFacts

func (o ShellOutput) AsFacts() map[string]interface{}

AsFacts implements the pkg.FactProvider interface. It returns a map representation suitable for registration, using lowercase keys for Ansible compatibility.

func (ShellOutput) Changed

func (o ShellOutput) Changed() bool

func (ShellOutput) String

func (o ShellOutput) String() string

type SlurpInput

type SlurpInput struct {
	Source string `yaml:"src"` // Path to the file to fetch from the remote node
}

SlurpInput defines the parameters for the slurp module.

func (SlurpInput) GetVariableUsage

func (i SlurpInput) GetVariableUsage() []string

GetVariableUsage extracts variables used within the source path.

func (SlurpInput) HasRevert

func (i SlurpInput) HasRevert() bool

HasRevert indicates that slurp does not have a revert action.

func (SlurpInput) ProvidesVariables

func (i SlurpInput) ProvidesVariables() []string

func (SlurpInput) ToCode

func (i SlurpInput) ToCode() string

ToCode generates the Go code representation of the SlurpInput.

func (*SlurpInput) UnmarshalYAML

func (i *SlurpInput) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML handles both shorthand (string) and map inputs for the slurp module.

func (SlurpInput) Validate

func (i SlurpInput) Validate() error

Validate checks if the required 'src' parameter is provided.

type SlurpModule

type SlurpModule struct{}

SlurpModule fetches a file from the remote host and stores its content.

func (SlurpModule) Doc added in v1.0.0

func (m SlurpModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (SlurpModule) Execute

func (m SlurpModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

Execute runs the slurp operation on the remote host.

func (SlurpModule) InputType

func (m SlurpModule) InputType() reflect.Type

func (SlurpModule) OutputType

func (m SlurpModule) OutputType() reflect.Type

func (SlurpModule) ParameterAliases

func (m SlurpModule) ParameterAliases() map[string]string

ParameterAliases defines aliases if needed.

func (SlurpModule) ParameterDocs added in v1.0.0

func (m SlurpModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for slurp module inputs.

func (SlurpModule) Revert

func (m SlurpModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

Revert for slurp is a no-op as it only reads information.

type SlurpOutput

type SlurpOutput struct {
	Content      string `json:"content"`  // Base64 encoded content of the file
	Source       string `json:"source"`   // The source path provided
	Encoding     string `json:"encoding"` // The encoding of the content (always base64)
	ChangedState bool   `json:"changed"`  // Indicates whether the module changed the system state
	pkg.ModuleOutput
}

SlurpOutput holds the result of the slurp operation.

func (SlurpOutput) AsFacts

func (o SlurpOutput) AsFacts() map[string]interface{}

AsFacts provides the output data in a map suitable for registration.

func (SlurpOutput) Changed

func (o SlurpOutput) Changed() bool

Changed indicates whether the module changed the system state. Slurp is read-only.

func (SlurpOutput) String

func (o SlurpOutput) String() string

String provides a human-readable summary of the SlurpOutput.

type StatDetails

type StatDetails struct {
	Exists     bool    `json:"exists"`
	Path       string  `json:"path"`
	Mode       string  `json:"mode,omitempty"`
	UID        int     `json:"uid,omitempty"`
	GID        int     `json:"gid,omitempty"`
	Size       int64   `json:"size,omitempty"`
	IsLnk      bool    `json:"islnk,omitempty"`
	IsReg      bool    `json:"isreg,omitempty"`
	IsDir      bool    `json:"isdir,omitempty"`
	IsFifo     bool    `json:"isfifo,omitempty"`
	IsBlk      bool    `json:"isblk,omitempty"`
	IsChr      bool    `json:"ischr,omitempty"`
	IsSock     bool    `json:"issock,omitempty"`
	Atime      float64 `json:"atime,omitempty"`
	Mtime      float64 `json:"mtime,omitempty"`
	Ctime      float64 `json:"ctime,omitempty"`
	Checksum   string  `json:"checksum,omitempty"`
	Mime       string  `json:"mime,omitempty"`
	Attributes string  `json:"attributes,omitempty"`
	Device     uint64  `json:"dev,omitempty"`        // Device number
	Inode      uint64  `json:"inode,omitempty"`      // Inode number
	NLink      uint64  `json:"nlink,omitempty"`      // Number of hard links
	Rdev       uint64  `json:"rdev,omitempty"`       // Device number (if special file)
	Blocks     int64   `json:"blocks,omitempty"`     // Number of blocks allocated
	BlockSize  int64   `json:"block_size,omitempty"` // Block size
	Owner      string  `json:"owner,omitempty"`
	Group      string  `json:"group,omitempty"`
}

StatDetails holds the detailed stat information for a file. This struct is used within StatOutput.

type StatInput

type StatInput struct {
	Path              string `yaml:"path"`
	ChecksumAlgorithm string `yaml:"checksum_algorithm,omitempty"`
	Follow            bool   `yaml:"follow,omitempty"`
	GetAttributes     bool   `yaml:"get_attributes,omitempty"`
	GetChecksum       bool   `yaml:"get_checksum,omitempty"`
	GetMime           bool   `yaml:"get_mime,omitempty"`
}

func (StatInput) GetVariableUsage

func (i StatInput) GetVariableUsage() []string

func (StatInput) HasRevert

func (i StatInput) HasRevert() bool

func (StatInput) ProvidesVariables

func (i StatInput) ProvidesVariables() []string

func (StatInput) ToCode

func (i StatInput) ToCode() string

func (StatInput) Validate

func (i StatInput) Validate() error

type StatModule

type StatModule struct{}

func (StatModule) Doc added in v1.0.0

func (sm StatModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (StatModule) Execute

func (m StatModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (StatModule) InputType

func (sm StatModule) InputType() reflect.Type

func (StatModule) OutputType

func (sm StatModule) OutputType() reflect.Type

func (StatModule) ParameterAliases

func (m StatModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (StatModule) ParameterDocs added in v1.0.0

func (sm StatModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for stat module inputs.

func (StatModule) Revert

func (m StatModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

Stat module is read-only, so Revert does nothing.

type StatOutput

type StatOutput struct {
	Stat StatDetails `json:"stat"`
	pkg.ModuleOutput
}

func (StatOutput) Changed

func (o StatOutput) Changed() bool

Stat module never changes state

func (StatOutput) String

func (o StatOutput) String() string

type SystemdInput

type SystemdInput struct {
	Name         string `yaml:"name"`
	State        string `yaml:"state"`
	Enabled      bool   `yaml:"enabled"`
	DaemonReload bool   `yaml:"daemon_reload"`
}

func (SystemdInput) GetVariableUsage

func (i SystemdInput) GetVariableUsage() []string

func (SystemdInput) HasRevert

func (i SystemdInput) HasRevert() bool

func (SystemdInput) ProvidesVariables

func (i SystemdInput) ProvidesVariables() []string

func (SystemdInput) ToCode

func (i SystemdInput) ToCode() string

func (SystemdInput) Validate

func (i SystemdInput) Validate() error

type SystemdModule

type SystemdModule struct{}

func (SystemdModule) DaemonReload

func (m SystemdModule) DaemonReload(c *pkg.HostContext, runAs string) error

func (SystemdModule) Disable

func (m SystemdModule) Disable(name string, c *pkg.HostContext, runAs string) error

func (SystemdModule) Doc added in v1.0.0

func (sm SystemdModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (SystemdModule) Enable

func (m SystemdModule) Enable(name string, c *pkg.HostContext, runAs string) error

func (SystemdModule) Execute

func (m SystemdModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (SystemdModule) InputType

func (sm SystemdModule) InputType() reflect.Type

func (SystemdModule) OutputType

func (sm SystemdModule) OutputType() reflect.Type

func (SystemdModule) ParameterAliases

func (m SystemdModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (SystemdModule) ParameterDocs added in v1.0.0

func (sm SystemdModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for systemd module inputs.

func (SystemdModule) Revert

func (m SystemdModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

func (SystemdModule) Start

func (m SystemdModule) Start(name string, c *pkg.HostContext, runAs string) error

func (SystemdModule) Stop

func (m SystemdModule) Stop(name string, c *pkg.HostContext, runAs string) error

type SystemdOutput

type SystemdOutput struct {
	State pkg.RevertableChange[SystemdState]
	pkg.ModuleOutput
}

func (SystemdOutput) Changed

func (o SystemdOutput) Changed() bool

func (SystemdOutput) String

func (o SystemdOutput) String() string

type SystemdState

type SystemdState struct {
	Enabled bool `yaml:"enabled"`
	Started bool `yaml:"started"`
}

func (SystemdState) Equal

func (s SystemdState) Equal(other SystemdState) bool

func (SystemdState) String

func (s SystemdState) String() string

type TemplateInput

type TemplateInput struct {
	Src  string `yaml:"src"`
	Dst  string `yaml:"dest"`
	Mode string `yaml:"mode"`
}

func (TemplateInput) GetVariableUsage

func (i TemplateInput) GetVariableUsage() []string

func (TemplateInput) HasRevert

func (i TemplateInput) HasRevert() bool

func (TemplateInput) ProvidesVariables

func (i TemplateInput) ProvidesVariables() []string

func (TemplateInput) ToCode

func (i TemplateInput) ToCode() string

func (TemplateInput) Validate

func (i TemplateInput) Validate() error

type TemplateModule

type TemplateModule struct{}

func (TemplateModule) Doc added in v1.0.0

func (sm TemplateModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (TemplateModule) Execute

func (m TemplateModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (TemplateModule) InputType

func (sm TemplateModule) InputType() reflect.Type

func (TemplateModule) OutputType

func (sm TemplateModule) OutputType() reflect.Type

func (TemplateModule) ParameterAliases

func (m TemplateModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (TemplateModule) ParameterDocs added in v1.0.0

func (sm TemplateModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for template module inputs.

func (TemplateModule) Revert

func (m TemplateModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

type TemplateOutput

type TemplateOutput struct {
	Contents       pkg.RevertableChange[string] `yaml:"-"` // Don't serialize diff in YAML
	ShouldShowDiff bool                         `yaml:"-"` // New field to control diff display
	// TODO: track if file was created
	pkg.ModuleOutput
}

func (TemplateOutput) Changed

func (o TemplateOutput) Changed() bool

func (TemplateOutput) String

func (o TemplateOutput) String() string

type YayInput

type YayInput struct {
	Name  []string `yaml:"name"`
	State string   `yaml:"state"`
}

func (YayInput) GetVariableUsage

func (i YayInput) GetVariableUsage() []string

func (YayInput) HasRevert

func (i YayInput) HasRevert() bool

func (YayInput) ProvidesVariables

func (i YayInput) ProvidesVariables() []string

func (YayInput) ToCode

func (i YayInput) ToCode() string

func (YayInput) Validate

func (i YayInput) Validate() error

type YayModule

type YayModule struct{}

func (YayModule) Doc added in v1.0.0

func (sm YayModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (YayModule) Execute

func (m YayModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

func (YayModule) InputType

func (sm YayModule) InputType() reflect.Type

func (YayModule) InstallPackages

func (m YayModule) InstallPackages(packages []string, c *pkg.HostContext, runAs string) (YayOutput, error)

func (YayModule) OutputType

func (sm YayModule) OutputType() reflect.Type

func (YayModule) ParameterAliases

func (m YayModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (YayModule) ParameterDocs added in v1.0.0

func (sm YayModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for yay module inputs.

func (YayModule) RemovePackages

func (m YayModule) RemovePackages(packages []string, c *pkg.HostContext, runAs string) (YayOutput, error)

func (YayModule) Revert

func (m YayModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

type YayOutput

type YayOutput struct {
	Installed []string
	Removed   []string
	Stdout    string
	Stderr    string
	pkg.ModuleOutput
}

func (YayOutput) Changed

func (o YayOutput) Changed() bool

func (YayOutput) String

func (o YayOutput) String() string

type YumInput added in v1.0.0

type YumInput struct {
	Name        interface{} `yaml:"name"`         // Name of the package(s) (string or list of strings)
	State       string      `yaml:"state"`        // present (default), absent, latest, installed, removed
	UpdateCache bool        `yaml:"update_cache"` // Run yum update before action
	Enablerepo  interface{} `yaml:"enablerepo"`   // List of repos to enable (string, comma-delimited string, or list)
	Disablerepo interface{} `yaml:"disablerepo"`  // List of repos to disable (string, comma-delimited string, or list)
	Exclude     interface{} `yaml:"exclude"`      // List of packages to exclude (string, comma-delimited string, or list)
	UpdateOnly  bool        `yaml:"update_only"`  // Only update packages, don't install/remove
	Autoremove  bool        `yaml:"autoremove"`   // If true, remove leaf deps; allowed alone or with state=absent/removed
	// Internal storage for parsed package list
	PkgNames []string
	// Internal storage for parsed repo lists
	EnablerepoList  []string
	DisablerepoList []string
	// Internal storage for parsed exclude list
	ExcludeList []string
}

YumInput defines the parameters for the yum module.

func (*YumInput) GetVariableUsage added in v1.0.0

func (i *YumInput) GetVariableUsage() []string

GetVariableUsage identifies variables used in the yum parameters.

func (*YumInput) HasRevert added in v1.0.0

func (i *YumInput) HasRevert() bool

HasRevert indicates if the action can be reverted.

func (*YumInput) ProvidesVariables added in v1.0.0

func (i *YumInput) ProvidesVariables() []string

func (*YumInput) ToCode added in v1.0.0

func (i *YumInput) ToCode() string

ToCode converts the YumInput struct into its Go code representation.

func (*YumInput) UnmarshalYAML added in v1.0.0

func (i *YumInput) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML handles shorthand and list formats for the yum module 'name'.

func (*YumInput) Validate added in v1.0.0

func (i *YumInput) Validate() error

Validate checks if the input parameters are valid.

type YumModule added in v1.0.0

type YumModule struct{}

YumModule implements the Ansible 'yum' module logic.

func (YumModule) Doc added in v1.0.0

func (ym YumModule) Doc() string

Doc returns module-level documentation rendered into Markdown.

func (YumModule) Execute added in v1.0.0

func (m YumModule) Execute(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, runAs string) (pkg.ModuleOutput, error)

Execute runs the yum module logic.

func (YumModule) InputType added in v1.0.0

func (ym YumModule) InputType() reflect.Type

func (YumModule) OutputType added in v1.0.0

func (ym YumModule) OutputType() reflect.Type

func (YumModule) ParameterAliases added in v1.0.0

func (m YumModule) ParameterAliases() map[string]string

ParameterAliases defines aliases for module parameters.

func (YumModule) ParameterDocs added in v1.0.0

func (ym YumModule) ParameterDocs() map[string]pkg.ParameterDoc

ParameterDocs provides rich documentation for yum module inputs.

func (YumModule) Revert added in v1.0.0

func (m YumModule) Revert(params pkg.ConcreteModuleInputProvider, closure *pkg.Closure, previous pkg.ModuleOutput, runAs string) (pkg.ModuleOutput, error)

Revert attempts to undo the action performed by Execute.

type YumOutput added in v1.0.0

type YumOutput struct {
	Packages    []string `yaml:"packages"` // Packages operated on
	Versions    []string `yaml:"versions"` // Versions installed/removed (if applicable)
	State       string   `yaml:"state"`    // Final state (installed, removed, updated)
	WasChanged  bool     // Internal flag to track if yum made changes
	UpdateCache bool     // Whether cache update was performed
	pkg.ModuleOutput
}

YumOutput defines the output of the yum module.

func (YumOutput) AsFacts added in v1.0.0

func (o YumOutput) AsFacts() map[string]interface{}

AsFacts implements the pkg.FactProvider interface.

func (YumOutput) Changed added in v1.0.0

func (o YumOutput) Changed() bool

Changed indicates if the yum module made changes to the system.

func (YumOutput) String added in v1.0.0

func (o YumOutput) String() string

String provides a string representation of the YumOutput.

Jump to

Keyboard shortcuts

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