nodetasks

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2016 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const FileType_Directory = "directory"
View Source
const FileType_File = "file"
View Source
const FileType_Symlink = "symlink"

Variables

This section is empty.

Functions

func NewMountDiskTask

func NewMountDiskTask(name string, contents string, meta string) (fi.Task, error)

func NewPackage

func NewPackage(name string, contents string, meta string) (fi.Task, error)

func NewService

func NewService(name string, contents string, meta string) (fi.Task, error)

func NewUserTask

func NewUserTask(name string, contents string, meta string) (fi.Task, error)

Types

type AssetDefinition

type AssetDefinition struct {
	AssetPath string `json:"assetPath"`
	Mode      string `json:"mode"`
}

type File

type File struct {
	Path     string
	Contents fi.Resource

	Mode        *string `json:"mode"`
	IfNotExists bool    `json:"ifNotExists"`

	OnChangeExecute []string `json:"onChangeExecute,omitempty"`

	Symlink *string `json:"symlink,omitempty"`
	Owner   *string `json:"owner,omitempty"`
	Group   *string `json:"group,omitempty"`
	Type    string  `json:"type"`
}

func NewFileTask

func NewFileTask(name string, src fi.Resource, destPath string, meta string) (*File, error)

func (*File) CheckChanges

func (s *File) CheckChanges(a, e, changes *File) error

func (*File) Find

func (e *File) Find(c *fi.Context) (*File, error)

func (*File) GetDependencies

func (f *File) GetDependencies(tasks map[string]fi.Task) []fi.Task

func (*File) RenderCloudInit

func (_ *File) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *File) error

func (*File) RenderLocal

func (_ *File) RenderLocal(t *local.LocalTarget, a, e, changes *File) error

func (*File) Run

func (e *File) Run(c *fi.Context) error

func (*File) String

func (f *File) String() string

type LoadImageTask

type LoadImageTask struct {
	Source string
	Hash   string
}

LoadImageTask is responsible for downloading a docker image

func (*LoadImageTask) CheckChanges

func (_ *LoadImageTask) CheckChanges(a, e, changes *LoadImageTask) error

func (*LoadImageTask) Find

func (e *LoadImageTask) Find(c *fi.Context) (*LoadImageTask, error)

func (*LoadImageTask) RenderCloudInit

func (_ *LoadImageTask) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *LoadImageTask) error

func (*LoadImageTask) RenderLocal

func (_ *LoadImageTask) RenderLocal(t *local.LocalTarget, a, e, changes *LoadImageTask) error

func (*LoadImageTask) Run

func (e *LoadImageTask) Run(c *fi.Context) error

func (*LoadImageTask) String

func (t *LoadImageTask) String() string

type MountDiskTask

type MountDiskTask struct {
	Name string

	Device     string `json:"device"`
	Mountpoint string `json:"mountpoint"`
}

MountDiskTask is responsible for mounting a device on a mountpoint It will wait for the device to show up, safe_format_and_mount it, and then mount it.

func (*MountDiskTask) CheckChanges

func (s *MountDiskTask) CheckChanges(a, e, changes *MountDiskTask) error

func (*MountDiskTask) Find

func (e *MountDiskTask) Find(c *fi.Context) (*MountDiskTask, error)

func (*MountDiskTask) RenderCloudInit

func (_ *MountDiskTask) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *MountDiskTask) error

func (*MountDiskTask) RenderLocal

func (_ *MountDiskTask) RenderLocal(t *local.LocalTarget, a, e, changes *MountDiskTask) error

func (*MountDiskTask) Run

func (e *MountDiskTask) Run(c *fi.Context) error

func (*MountDiskTask) String

func (s *MountDiskTask) String() string

type Package

type Package struct {
	Name string

	Version      *string `json:"version"`
	Source       *string `json:"source"`
	Hash         *string `json:"hash"`
	PreventStart *bool   `json:"preventStart"`

	// Healthy is true if the package installation did not fail
	Healthy *bool `json:"healthy"`
}

func (*Package) CheckChanges

func (s *Package) CheckChanges(a, e, changes *Package) error

func (*Package) Find

func (e *Package) Find(c *fi.Context) (*Package, error)

func (*Package) GetDependencies

func (p *Package) GetDependencies(tasks map[string]fi.Task) []fi.Task

GetDependencies computes dependencies for the package task

func (*Package) RenderCloudInit

func (_ *Package) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *Package) error

func (*Package) RenderLocal

func (_ *Package) RenderLocal(t *local.LocalTarget, a, e, changes *Package) error

func (*Package) Run

func (e *Package) Run(c *fi.Context) error

func (*Package) String

func (p *Package) String() string

String returns a string representation, implementing the Stringer interface

type Service

type Service struct {
	Name       string
	Definition *string
	Running    *bool

	// Enabled configures the service to start at boot (or not start at boot)
	Enabled *bool

	ManageState  *bool `json:"manageState"`
	SmartRestart *bool `json:"smartRestart"`
}

func (*Service) CheckChanges

func (s *Service) CheckChanges(a, e, changes *Service) error

func (*Service) Find

func (e *Service) Find(c *fi.Context) (*Service, error)

func (*Service) GetDependencies

func (p *Service) GetDependencies(tasks map[string]fi.Task) []fi.Task

func (*Service) RenderCloudInit

func (_ *Service) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *Service) error

func (*Service) RenderLocal

func (_ *Service) RenderLocal(t *local.LocalTarget, a, e, changes *Service) error

func (*Service) Run

func (e *Service) Run(c *fi.Context) error

func (*Service) String

func (s *Service) String() string

type UpdatePackages

type UpdatePackages struct {
	// We can't be completely empty or we don't run
	Updated bool
}

func NewUpdatePackages added in v1.4.1

func NewUpdatePackages() *UpdatePackages

func (*UpdatePackages) CheckChanges

func (s *UpdatePackages) CheckChanges(a, e, changes *UpdatePackages) error

func (*UpdatePackages) Find

func (e *UpdatePackages) Find(c *fi.Context) (*UpdatePackages, error)

func (*UpdatePackages) GetDependencies

func (p *UpdatePackages) GetDependencies(tasks map[string]fi.Task) []fi.Task

func (*UpdatePackages) RenderCloudInit

func (_ *UpdatePackages) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *UpdatePackages) error

func (*UpdatePackages) RenderLocal

func (_ *UpdatePackages) RenderLocal(t *local.LocalTarget, a, e, changes *UpdatePackages) error

func (*UpdatePackages) Run

func (e *UpdatePackages) Run(c *fi.Context) error

func (*UpdatePackages) String

func (p *UpdatePackages) String() string

type UserTask

type UserTask struct {
	Name string

	Shell string `json:"shell"`
	Home  string `json:"home"`
}

UserTask is responsible for creating a user, by calling useradd

func (*UserTask) CheckChanges

func (_ *UserTask) CheckChanges(a, e, changes *UserTask) error

func (*UserTask) Find

func (e *UserTask) Find(c *fi.Context) (*UserTask, error)

func (*UserTask) RenderCloudInit

func (_ *UserTask) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *UserTask) error

func (*UserTask) RenderLocal

func (_ *UserTask) RenderLocal(t *local.LocalTarget, a, e, changes *UserTask) error

func (*UserTask) Run

func (e *UserTask) Run(c *fi.Context) error

func (*UserTask) String

func (e *UserTask) String() string

Jump to

Keyboard shortcuts

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