Documentation
¶
Overview ¶
Package playbook provides the base types and interfaces for creating automation playbooks using SSH-based remote execution.
Index ¶
Constants ¶
const ( // NamePing checks SSH connectivity NamePing = "ping" // NameAptUpdate refreshes the package database NameAptUpdate = "apt-update" // NameAptUpgrade installs available updates NameAptUpgrade = "apt-upgrade" // NameAptStatus shows available updates NameAptStatus = "apt-status" // NameReboot reboots the server NameReboot = "reboot" // NameSwapCreate creates a swap file (requires "size" arg in GB) NameSwapCreate = "swap-create" // NameSwapDelete removes the swap file NameSwapDelete = "swap-delete" // NameSwapStatus shows swap status NameSwapStatus = "swap-status" // NameUserCreate creates a user with sudo (requires "username" arg) NameUserCreate = "user-create" // NameUserDelete deletes a user (requires "username" arg) NameUserDelete = "user-delete" // NameUserStatus shows user info (accepts optional "username" arg) NameUserStatus = "user-status" )
Playbook name constants for use with RunPlaybook. These constants provide compile-time safety and IDE autocomplete for playbook names.
Example:
node := ork.NewNodeForHost("server.example.com")
err := node.RunPlaybook(playbook.NamePing)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Playbook ¶
type Playbook interface {
// Name returns the unique identifier for this playbook (e.g., "apt-update")
Name() string
// Description returns a short description of what the playbook does
Description() string
// Run executes the playbook with the given configuration
Run(config config.Config) error
}
Playbook is the interface that all playbooks must implement. A playbook is a self-contained automation task that runs on a remote server.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds a collection of playbooks.
type SimplePlaybook ¶
type SimplePlaybook struct {
// contains filtered or unexported fields
}
SimplePlaybook is a function-based playbook implementation. Use this for simple playbooks that don't need complex state.
func NewSimplePlaybook ¶
func NewSimplePlaybook(name, description string, runFn func(config.Config) error) *SimplePlaybook
NewSimplePlaybook creates a new simple playbook from a function.
func (*SimplePlaybook) Description ¶
func (p *SimplePlaybook) Description() string
Description returns the playbook description.
func (*SimplePlaybook) Name ¶
func (p *SimplePlaybook) Name() string
Name returns the playbook name.