provision: github.com/digitalrebar/provision/agent Index | Files

package agent

import "github.com/digitalrebar/provision/agent"

Index

Package Files

agent.go chroot_linux.go cmdHelper.go mktd.go taskRunner.go

Constants

const (
    AGENT_INIT = state(iota)
    AGENT_WAIT_FOR_RUNNABLE
    AGENT_RUN_TASK
    AGENT_WAIT_FOR_CHANGE_STAGE
    AGENT_CHANGE_STAGE
    AGENT_EXIT
    AGENT_REBOOT
    AGENT_POWEROFF
    AGENT_KEXEC
)

type Agent Uses

type Agent struct {
    // contains filtered or unexported fields
}

Agent implements a new machine agent structured as a finite state machine. There is one important behavioural change to the behaviour of the runner that may impact how workflows are built:

The RunnerWait flag in stages is no longer honored. Instead, the agent will wait by default, unless overridden by the following conditions, in order of priority:

* The next stage has the Reboot flag set.

* The change-stage/map entry for the next stage has a Stop, Reboot,

or Poweroff clause.

* The machine is currently in a bootenv that ends in -install and

there is nothing else to do, in which case the runner will exit

Additionally, this agent will automatically reboot the system when it detects that the machine's boot environment has changed, unless the machine is in an OS install, in which case the agent will exit.

func New Uses

func New(c *api.Client, m *models.Machine,
    exitOnNotRunnable, exitOnFailure, actuallyPowerThings bool,
    logger io.Writer) (*Agent, error)

New creates a new FSM based Machine Agent that starts out in the AGENT_INIT state.

func (*Agent) Run Uses

func (a *Agent) Run() error

Run kicks off the state machine for this agent.

func (*Agent) StateLoc Uses

func (a *Agent) StateLoc(s string) *Agent

func (*Agent) Timeout Uses

func (a *Agent) Timeout(t time.Duration) *Agent

Timeout allows you to change how long the Agent will wait for an event from dr-provision from the default of 1 hour.

Package agent imports 22 packages (graph) and is imported by 2 packages. Updated 2019-08-19. Refresh now. Tools for package owners.