resource

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Directory = &cofu.ResourceType{
	Name: "directory",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"create"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "path",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name: "mode",
		},
		&cofu.StringAttribute{
			Name: "owner",
		},
		&cofu.StringAttribute{
			Name: "group",
		},
	},
	PreAction:                directoryPreAction,
	SetCurrentAttributesFunc: directorySetCurrentAttributes,
	ShowDifferences:          directoryShowDifferences,
	Actions: map[string]cofu.ResourceAction{
		"create": directoryCreateAction,
		"delete": directoryDeleteAction,
	},
}
View Source
var Execute = &cofu.ResourceType{
	Name: "execute",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"run"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "command",
			DefaultName: true,
			Required:    true,
		},
	},
	PreAction:                executePreAction,
	SetCurrentAttributesFunc: executeSetCurrentAttributes,
	Actions: map[string]cofu.ResourceAction{
		"run": executeRunAction,
	},
}
View Source
var File = &cofu.ResourceType{
	Name: "file",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"create"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "path",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name: "content",
		},
		&cofu.StringAttribute{
			Name: "mode",
		},
		&cofu.StringAttribute{
			Name: "owner",
		},
		&cofu.StringAttribute{
			Name: "group",
		},
	},
	PreAction:                filePreAction,
	SetCurrentAttributesFunc: fileSetCurrentAttributes,
	ShowDifferences:          fileShowDifferences,
	Actions: map[string]cofu.ResourceAction{
		"create": fileCreateAction,
		"delete": fileDeleteAction,
	},
}
View Source
var Git = &cofu.ResourceType{
	Name: "git",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"sync"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "destination",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name:     "repository",
			Required: true,
		},
		&cofu.StringAttribute{
			Name: "revision",
		},
		&cofu.BoolAttribute{
			Name:    "recursive",
			Default: false,
		},
	},
	PreAction:                gitPreAction,
	SetCurrentAttributesFunc: gitSetCurrentAttributes,
	Actions: map[string]cofu.ResourceAction{
		"sync": gitSyncAction,
	},
}
View Source
var Group = &cofu.ResourceType{
	Name: "group",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"create"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "groupname",
			DefaultName: true,
			Required:    true,
		},
		&cofu.IntegerAttribute{
			Name: "gid",
		},
	},
	PreAction:                groupPreAction,
	SetCurrentAttributesFunc: groupSetCurrentAttributes,
	Actions: map[string]cofu.ResourceAction{
		"create": groupCreateAction,
	},
}
View Source
var Link = &cofu.ResourceType{
	Name: "link",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"create"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "link",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name:     "to",
			Required: true,
		},
		&cofu.BoolAttribute{
			Name: "force",
		},
	},
	PreAction:                linkPreAction,
	SetCurrentAttributesFunc: linkSetCurrentAttributes,
	Actions: map[string]cofu.ResourceAction{
		"create": linkCreateAction,
	},
}
View Source
var LuaFunction = &cofu.ResourceType{
	Name: "lua_function",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"run"},
			Required: true,
		},
		&cofu.LFunctionAttribute{
			Name:     "func",
			Required: true,
		},
	},
	PreAction:                luaFunctionPreAction,
	SetCurrentAttributesFunc: luaFunctionSetCurrentAttributes,
	Actions: map[string]cofu.ResourceAction{
		"run": luaFunctionRunAction,
	},
}
View Source
var RemoteDirectory = &cofu.ResourceType{
	Name: "remote_directory",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"create"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "path",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name:     "source",
			Required: true,
		},
		&cofu.StringAttribute{
			Name: "mode",
		},
		&cofu.StringAttribute{
			Name: "owner",
		},
		&cofu.StringAttribute{
			Name: "group",
		},
	},
	PreAction:                remoteDirectoryPreAction,
	SetCurrentAttributesFunc: remoteDirectorySetCurrentAttributes,
	ShowDifferences:          remoteDirectoryShowDifferences,
	Actions: map[string]cofu.ResourceAction{
		"create": remoteDirectoryCreateAction,
		"delete": remoteDirectoryDeleteAction,
	},
}
View Source
var RemoteFile = &cofu.ResourceType{
	Name: "remote_file",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"create"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "path",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name: "content",
		},
		&cofu.StringAttribute{
			Name: "source",
		},
		&cofu.StringAttribute{
			Name: "mode",
		},
		&cofu.StringAttribute{
			Name: "owner",
		},
		&cofu.StringAttribute{
			Name: "group",
		},
	},
	PreAction:                remoteFilePreAction,
	SetCurrentAttributesFunc: remoteFileSetCurrentAttributes,
	ShowDifferences:          remoteFileShowDifferences,
	Actions: map[string]cofu.ResourceAction{
		"create": remoteFileCreateAction,
		"delete": remoteFileDeleteAction,
	},
}
View Source
var Service = &cofu.ResourceType{
	Name: "service",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"nothing"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "name",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name: "provider",
		},
	},
	PreAction:                servicePreAction,
	SetCurrentAttributesFunc: serviceSetCurrentAttributes,
	Actions: map[string]cofu.ResourceAction{
		"start":   serviceStartAction,
		"stop":    serviceStopAction,
		"restart": serviceRestartAction,
		"reload":  serviceReloadAction,
		"enable":  serviceEnableAction,
		"disable": serviceDisableAction,
	},
}
View Source
var SoftwarePackage = &cofu.ResourceType{
	Name: "software_package",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"install"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "name",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name: "version",
		},
		&cofu.StringAttribute{
			Name: "options",
		},
	},
	PreAction:                packagePreAction,
	SetCurrentAttributesFunc: packageSetCurrentAttributes,
	Actions: map[string]cofu.ResourceAction{
		"install": packageInstallAction,
		"remove":  packageRemoveAction,
	},
}
View Source
var Template = &cofu.ResourceType{
	Name: "template",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"create"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "path",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name: "content",
		},
		&cofu.StringAttribute{
			Name: "source",
		},
		&cofu.MapAttribute{
			Name:    "variables",
			Default: map[string]interface{}{},
		},
		&cofu.StringAttribute{
			Name: "mode",
		},
		&cofu.StringAttribute{
			Name: "owner",
		},
		&cofu.StringAttribute{
			Name: "group",
		},
	},
	PreAction:                templatePreAction,
	SetCurrentAttributesFunc: templateSetCurrentAttributes,
	ShowDifferences:          templateShowDifferences,
	Actions: map[string]cofu.ResourceAction{
		"create": templateCreateAction,
		"delete": templateDeleteAction,
	},
}
View Source
var User = &cofu.ResourceType{
	Name: "user",
	Attributes: []cofu.Attribute{
		&cofu.StringSliceAttribute{
			Name:     "action",
			Default:  []string{"create"},
			Required: true,
		},
		&cofu.StringAttribute{
			Name:        "username",
			DefaultName: true,
			Required:    true,
		},
		&cofu.StringAttribute{
			Name: "gid",
		},
		&cofu.StringAttribute{
			Name: "home",
		},
		&cofu.StringAttribute{
			Name: "password",
		},
		&cofu.BoolAttribute{
			Name:    "system_user",
			Default: false,
		},
		&cofu.IntegerAttribute{
			Name: "uid",
		},
		&cofu.StringAttribute{
			Name: "shell",
		},
		&cofu.BoolAttribute{
			Name:    "create_home",
			Default: false,
		},
	},
	PreAction:                userPreAction,
	SetCurrentAttributesFunc: userSetCurrentAttributes,
	Actions: map[string]cofu.ResourceAction{
		"create": userCreateAction,
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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