Documentation
¶
Index ¶
- func Add(add ...Item)
- func AddFromSource(source string, add ...Item)
- func Apply() error
- func RedError(e error) string
- func RedPrintln(s string)
- func SetAssetLoader(fn func(string) (io.ReadCloser, error))
- func SetDescribe(s string)
- func SetSourcePrefix(s string)
- func SetTitle(s string)
- func Warnf(str string, args ...interface{})
- type Color
- type File
- func (f *File) After() []string
- func (f *File) Apply(host *Host) (itemStatus, error)
- func (f *File) Before() []string
- func (f *File) Clone() Item
- func (f *File) ID() int
- func (f *File) Provides() []string
- func (f *File) SetID(id int)
- func (f *File) StaticFiles() []string
- func (f *File) String() string
- func (f *File) Validate() error
- type FuncType
- type Function
- func (f *Function) After() []string
- func (f *Function) Apply(host *Host) (itemStatus, error)
- func (f *Function) Before() []string
- func (f *Function) Clone() Item
- func (f *Function) ID() int
- func (f *Function) Provides() []string
- func (f *Function) SetID(id int)
- func (f *Function) StaticFiles() []string
- func (f *Function) String() string
- func (f *Function) Validate() error
- type Group
- type Host
- type Item
- type Package
- type Run
- type StaticFiler
- type User
- type Validator
- type VaultResponse
- type VaultResponseData
- type Virtual
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFromSource ¶
Add to the default run context with explicit source path
func RedPrintln ¶
func RedPrintln(s string)
func SetAssetLoader ¶
func SetAssetLoader(fn func(string) (io.ReadCloser, error))
func SetDescribe ¶
func SetDescribe(s string)
func SetSourcePrefix ¶
func SetSourcePrefix(s string)
Types ¶
type File ¶
type File struct {
Path string `khan:"path,shortkey"`
User string
Group string
Mode os.FileMode
// Content specifies a static string for the content of the file.
Content string
// Src is a path on the configurer for the source of the file.
// This will be bundled into your khan build output.
Src string `khan:"src,shortvalue"`
// Local is a path on the configuree for the source of the file
Local string
// Template execution mode. Leave blank for no templating. Special
// value "1" is the same as the default templating engine "pongo2",
// a jinja2 style template engine. (See https://github.com/flosch/pongo2)
Template string
Delete bool
// contains filtered or unexported fields
}
func (*File) StaticFiles ¶
type Function ¶
type Function struct {
Fn FuncType
// contains filtered or unexported fields
}
func (*Function) StaticFiles ¶
type Host ¶
type Host struct {
Run *Run
Name string // Friendly name for host
SSH bool
Host string // Host for SSH
// contains filtered or unexported fields
}
Host is the context for an execution run on a specific server. It contains a virtual model of all changes we are capable of making on a server, including service status and a filesystem. This way a dry run can be pixel-perfect.
type Item ¶
type Run ¶
type Run struct {
Dry bool
Diff bool
Verbose bool
Pool *sshpool.Pool
Hosts []*Host
// contains filtered or unexported fields
}
Run is the context for an execution run, on one or more servers.
type StaticFiler ¶
type StaticFiler interface {
StaticFiles() []string
}
type User ¶
type User struct {
Name string
// Primary group. If not specified, user name is used
Group string
Uid uint32
// Supplemental groups
Groups []string
Comment string // Gecos field
Home string
Shell string
// Password is the passord encrypted with libcrypt.
// Password if blank will actually be set to "!". If "!", "!!", or "x" are found
// in /etc/shadow, it will be translated to a blank password. If you want an actually
// blank password (not safe) use BlankPassword: true (blank_password: true in yaml).
Password string
BlankPassword bool `khan:"blank_password"`
Delete bool
// contains filtered or unexported fields
}
type VaultResponse ¶
type VaultResponse struct {
Data VaultResponseData
}
type VaultResponseData ¶
type Virtual ¶
type Virtual struct {
// Host metadata extracted from uname command
Uname string
Hostname string
Kernel string
OS string
Arch string
// File system model
Files map[string]os.FileInfo
Content map[string]string
// User and group model
Users map[string]*User
Groups map[string]*Group
// contains filtered or unexported fields
}
Virtual is an in-memory model for all changes we are capable of making on a server, including service status and a filesystem. This way a dry run can be pixel-perfect.
If you start managing files with contents too large for RAM, this will need to be improved. (Currently all managed files, including contents, are in kept in memory in their entirety.)
func NewVirtual ¶
func NewVirtual() *Virtual