Documentation ¶
Index ¶
- Constants
- func NewMountDiskTask(name string, contents string, meta string) (fi.Task, error)
- func NewPackage(name string, contents string, meta string) (fi.Task, error)
- func NewService(name string, contents string, meta string) (fi.Task, error)
- func NewUserTask(name string, contents string, meta string) (fi.Task, error)
- type Archive
- func (_ *Archive) CheckChanges(a, e, changes *Archive) error
- func (e *Archive) Dir() string
- func (e *Archive) Find(c *fi.Context) (*Archive, error)
- func (e *Archive) GetDependencies(tasks map[string]fi.Task) []fi.Task
- func (e *Archive) GetName() *string
- func (_ *Archive) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *Archive) error
- func (_ *Archive) RenderLocal(t *local.LocalTarget, a, e, changes *Archive) error
- func (e *Archive) Run(c *fi.Context) error
- func (e *Archive) SetName(name string)
- func (e *Archive) String() string
- type AssetDefinition
- type BindMount
- func (s *BindMount) CheckChanges(a, e, changes *BindMount) error
- func (e *BindMount) Dir() string
- func (e *BindMount) Find(c *fi.Context) (*BindMount, error)
- func (e *BindMount) GetDependencies(tasks map[string]fi.Task) []fi.Task
- func (e *BindMount) GetName() *string
- func (_ *BindMount) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *BindMount) error
- func (_ *BindMount) RenderLocal(t *local.LocalTarget, a, e, changes *BindMount) error
- func (e *BindMount) Run(c *fi.Context) error
- func (e *BindMount) SetName(name string)
- func (s *BindMount) String() string
- type Chattr
- func (s *Chattr) CheckChanges(a, e, changes *Chattr) error
- func (e *Chattr) Find(c *fi.Context) (*Chattr, error)
- func (e *Chattr) GetDependencies(tasks map[string]fi.Task) []fi.Task
- func (e *Chattr) GetName() *string
- func (_ *Chattr) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *Chattr) error
- func (_ *Chattr) RenderLocal(t *local.LocalTarget, a, e, changes *Chattr) error
- func (e *Chattr) Run(c *fi.Context) error
- func (e *Chattr) SetName(name string)
- func (s *Chattr) String() string
- type CreatesDir
- type Executor
- type File
- func (s *File) CheckChanges(a, e, changes *File) error
- func (f *File) Dir() string
- func (e *File) Find(c *fi.Context) (*File, error)
- func (e *File) GetDependencies(tasks map[string]fi.Task) []fi.Task
- func (f *File) GetName() *string
- func (_ *File) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *File) error
- func (_ *File) RenderLocal(t *local.LocalTarget, a, e, changes *File) error
- func (e *File) Run(c *fi.Context) error
- func (f *File) SetName(name string)
- func (f *File) String() string
- type GroupTask
- func (_ *GroupTask) CheckChanges(a, e, changes *GroupTask) error
- func (e *GroupTask) Find(c *fi.Context) (*GroupTask, error)
- func (f *GroupTask) GetName() *string
- func (_ *GroupTask) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *GroupTask) error
- func (_ *GroupTask) RenderLocal(t *local.LocalTarget, a, e, changes *GroupTask) error
- func (e *GroupTask) Run(c *fi.Context) error
- func (f *GroupTask) SetName(name string)
- func (e *GroupTask) String() string
- type LoadImageTask
- func (_ *LoadImageTask) CheckChanges(a, e, changes *LoadImageTask) error
- func (e *LoadImageTask) Find(c *fi.Context) (*LoadImageTask, error)
- func (t *LoadImageTask) GetDependencies(tasks map[string]fi.Task) []fi.Task
- func (_ *LoadImageTask) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *LoadImageTask) error
- func (_ *LoadImageTask) RenderLocal(t *local.LocalTarget, a, e, changes *LoadImageTask) error
- func (e *LoadImageTask) Run(c *fi.Context) error
- func (t *LoadImageTask) String() string
- type MountDiskTask
- func (s *MountDiskTask) CheckChanges(a, e, changes *MountDiskTask) error
- func (e *MountDiskTask) Dir() string
- func (e *MountDiskTask) Find(c *fi.Context) (*MountDiskTask, error)
- func (e *MountDiskTask) GetDependencies(tasks map[string]fi.Task) []fi.Task
- func (_ *MountDiskTask) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *MountDiskTask) error
- func (_ *MountDiskTask) RenderLocal(t *local.LocalTarget, a, e, changes *MountDiskTask) error
- func (e *MountDiskTask) Run(c *fi.Context) error
- func (s *MountDiskTask) String() string
- type Package
- func (_ *Package) CheckChanges(a, e, changes *Package) error
- func (e *Package) Find(c *fi.Context) (*Package, error)
- func (e *Package) GetDependencies(tasks map[string]fi.Task) []fi.Task
- func (f *Package) GetName() *string
- func (_ *Package) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *Package) error
- func (_ *Package) RenderLocal(t *local.LocalTarget, a, e, changes *Package) error
- func (e *Package) Run(c *fi.Context) error
- func (f *Package) SetName(name string)
- func (p *Package) String() string
- type Service
- func (s *Service) CheckChanges(a, e, changes *Service) error
- func (e *Service) Find(c *fi.Context) (*Service, error)
- func (p *Service) GetDependencies(tasks map[string]fi.Task) []fi.Task
- func (f *Service) GetName() *string
- func (s *Service) InitDefaults()
- func (_ *Service) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *Service) error
- func (_ *Service) RenderLocal(t *local.LocalTarget, a, e, changes *Service) error
- func (e *Service) Run(c *fi.Context) error
- func (f *Service) SetName(name string)
- func (s *Service) String() string
- type UpdatePackages
- func (s *UpdatePackages) CheckChanges(a, e, changes *UpdatePackages) error
- func (e *UpdatePackages) Find(c *fi.Context) (*UpdatePackages, error)
- func (p *UpdatePackages) GetDependencies(tasks map[string]fi.Task) []fi.Task
- func (_ *UpdatePackages) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *UpdatePackages) error
- func (_ *UpdatePackages) RenderLocal(t *local.LocalTarget, a, e, changes *UpdatePackages) error
- func (e *UpdatePackages) Run(c *fi.Context) error
- func (p *UpdatePackages) String() string
- type UserTask
- func (_ *UserTask) CheckChanges(a, e, changes *UserTask) error
- func (e *UserTask) Find(c *fi.Context) (*UserTask, error)
- func (f *UserTask) GetName() *string
- func (_ *UserTask) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *UserTask) error
- func (_ *UserTask) RenderLocal(t *local.LocalTarget, a, e, changes *UserTask) error
- func (e *UserTask) Run(c *fi.Context) error
- func (f *UserTask) SetName(name string)
- func (e *UserTask) String() string
Constants ¶
const ( // FileType_Symlink defines a symlink FileType_Symlink = "symlink" // FileType_Directory defines a directory FileType_Directory = "directory" // FileType_File is a regualar file FileType_File = "file" )
Variables ¶
This section is empty.
Functions ¶
func NewMountDiskTask ¶
Types ¶
type Archive ¶
type Archive struct { Name string // Source is the location for the archive Source string `json:"source,omitempty"` // Hash is the source tar Hash string `json:"hash,omitempty"` // TargetDir is the directory for extraction TargetDir string `json:"target,omitempty"` // StripComponents is the number of components to remove when expanding the archive StripComponents int `json:"stripComponents,omitempty"` }
Archive task downloads and extracts a tar file
func (*Archive) CheckChanges ¶
CheckChanges implements fi.Task::CheckChanges
func (*Archive) GetDependencies ¶
GetDependencies implements HasDependencies::GetDependencies
func (*Archive) RenderCloudInit ¶
func (_ *Archive) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *Archive) error
RenderCloudInit implements fi.Task::Render functionality for a CloudInit target
func (*Archive) RenderLocal ¶
func (_ *Archive) RenderLocal(t *local.LocalTarget, a, e, changes *Archive) error
RenderLocal implements the fi.Task::Render functionality for a local target
type AssetDefinition ¶
type BindMount ¶
type BindMount struct { Source string `json:"source"` Mountpoint string `json:"mountpoint"` Options []string `json:"options,omitempty"` Recursive bool `json:"recursive"` }
BindMount performs bind mounts
func (*BindMount) CheckChanges ¶
func (*BindMount) GetDependencies ¶
GetDependencies implements HasDependencies::GetDependencies
func (*BindMount) RenderCloudInit ¶
func (_ *BindMount) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *BindMount) error
func (*BindMount) RenderLocal ¶
func (_ *BindMount) RenderLocal(t *local.LocalTarget, a, e, changes *BindMount) error
type Chattr ¶
type Chattr struct { File string `json:"file"` Mode string `json:"mode"` Deps []fi.Task `json:"-"` }
Chattr performs a chattr command, in particular to set a file as immutable
func (*Chattr) CheckChanges ¶
func (*Chattr) GetDependencies ¶
GetDependencies implements HasDependencies::GetDependencies
func (*Chattr) RenderCloudInit ¶
func (_ *Chattr) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *Chattr) error
func (*Chattr) RenderLocal ¶
func (_ *Chattr) RenderLocal(t *local.LocalTarget, a, e, changes *Chattr) error
type CreatesDir ¶
type CreatesDir interface {
Dir() string
}
CreatesDir is a marker interface for tasks that create directories, used for dependencies
type File ¶
type File struct { AfterFiles []string `json:"afterfiles,omitempty"` Contents fi.Resource `json:"contents,omitempty"` Group *string `json:"group,omitempty"` IfNotExists bool `json:"ifNotExists,omitempty"` Mode *string `json:"mode,omitempty"` OnChangeExecute [][]string `json:"onChangeExecute,omitempty"` Owner *string `json:"owner,omitempty"` Path string `json:"path,omitempty"` Symlink *string `json:"symlink,omitempty"` Type string `json:"type"` }
func NewFileTask ¶
func (*File) CheckChanges ¶
func (*File) GetDependencies ¶
GetDependencies implements HasDependencies::GetDependencies
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
type GroupTask ¶
GroupTask is responsible for creating a group, by calling groupadd
func (*GroupTask) CheckChanges ¶
func (*GroupTask) RenderCloudInit ¶
func (_ *GroupTask) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *GroupTask) error
func (*GroupTask) RenderLocal ¶
func (_ *GroupTask) RenderLocal(t *local.LocalTarget, a, e, changes *GroupTask) error
type LoadImageTask ¶
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) GetDependencies ¶
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) 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) GetDependencies ¶
GetDependencies implements HasDependencies::GetDependencies
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) String ¶
func (s *MountDiskTask) String() string
type Package ¶
type Package struct { Name string Version *string `json:"version,omitempty"` Source *string `json:"source,omitempty"` Hash *string `json:"hash,omitempty"` PreventStart *bool `json:"preventStart,omitempty"` // Healthy is true if the package installation did not fail Healthy *bool `json:"healthy,omitempty"` // Additional dependencies that must be installed before this package. // These will actually be passed together with this package to rpm/dpkg, // which will then figure out the correct order in which to install them. // This means that Deps don't get installed unless this package needs to // get installed. Deps []*Package `json:"deps,omitempty"` }
func (*Package) CheckChanges ¶
func (*Package) GetDependencies ¶
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
type Service ¶
type Service struct { Name string Definition *string `json:"definition,omitempty"` Running *bool `json:"running,omitempty"` // Enabled configures the service to start at boot (or not start at boot) Enabled *bool `json:"enabled,omitempty"` ManageState *bool `json:"manageState,omitempty"` SmartRestart *bool `json:"smartRestart,omitempty"` }
func (*Service) CheckChanges ¶
func (*Service) GetDependencies ¶
func (*Service) InitDefaults ¶
func (s *Service) InitDefaults()
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
type UpdatePackages ¶
type UpdatePackages struct { // We can't be completely empty or we don't run Updated bool }
func NewUpdatePackages ¶
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 (*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) String ¶
func (p *UpdatePackages) String() string
type UserTask ¶
type UserTask struct { Name string UID int `json:"uid"` Shell string `json:"shell"` Home string `json:"home"` }
UserTask is responsible for creating a user, by calling useradd
func (*UserTask) CheckChanges ¶
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