1
0
mirror of https://github.com/rancher/os.git synced 2025-06-19 19:51:55 +00:00
os/config/types.go

134 lines
5.0 KiB
Go
Raw Normal View History

2015-03-15 04:27:04 +00:00
package config
import (
"github.com/coreos/coreos-cloudinit/config"
2015-07-29 07:45:06 +00:00
"github.com/rancher/netconf"
"github.com/rancherio/rancher-compose/librcompose/project"
)
2015-03-15 04:27:04 +00:00
const (
CONSOLE_CONTAINER = "console"
DOCKER_BIN = "/usr/bin/docker"
2015-07-29 07:51:49 +00:00
ROS_BIN = "/usr/bin/ros"
SYSINIT_BIN = "/usr/bin/ros-sysinit"
DOCKER_SYSTEM_HOME = "/var/lib/system-docker"
DOCKER_SYSTEM_HOST = "unix:///var/run/system-docker.sock"
DOCKER_HOST = "unix:///var/run/docker.sock"
2015-07-29 07:51:49 +00:00
IMAGES_PATH = "/usr/share/ros"
IMAGES_PATTERN = "images*.tar"
MODULES_ARCHIVE = "/modules.tar"
DEBUG = false
2015-07-29 07:51:49 +00:00
SYSTEM_DOCKER_LOG = "/var/log/system-docker.log"
LABEL = "label"
HASH = "io.rancher.os.hash"
ID = "io.rancher.os.id"
DETACH = "io.rancher.os.detach"
REMOVE = "io.rancher.os.remove"
CREATE_ONLY = "io.rancher.os.createonly"
RELOAD_CONFIG = "io.rancher.os.reloadconfig"
2015-04-16 05:57:59 +00:00
SCOPE = "io.rancher.os.scope"
SYSTEM = "system"
OsConfigFile = "/os-config.yml"
CloudConfigFile = "/var/lib/rancher/conf/cloud-config.yml"
CloudConfigScriptFile = "/var/lib/rancher/conf/cloud-config-script"
MetaDataFile = "/var/lib/rancher/conf/metadata"
LocalConfigFile = "/var/lib/rancher/conf/cloud-config-local.yml"
PrivateConfigFile = "/var/lib/rancher/conf/cloud-config-private.yml"
2015-03-15 04:27:04 +00:00
)
var (
VERSION string
2015-03-15 04:27:04 +00:00
)
type ContainerConfig struct {
Id string `yaml:"id,omitempty"`
Cmd string `yaml:"run,omitempty"`
MigrateVolumes bool `yaml:"migrate_volumes,omitempty"`
ReloadConfig bool `yaml:"reload_config,omitempty"`
CreateOnly bool `yaml:create_only,omitempty`
Service *project.ServiceConfig `yaml:service,omitempty`
2015-03-15 04:27:04 +00:00
}
2015-04-16 05:57:59 +00:00
type Repository struct {
Url string `yaml:url,omitempty`
}
type Repositories map[string]Repository
type CloudConfig struct {
SSHAuthorizedKeys []string `yaml:"ssh_authorized_keys"`
WriteFiles []config.File `yaml:"write_files"`
Hostname string `yaml:"hostname"`
Users []config.User `yaml:"users"`
Rancher RancherConfig `yaml:"rancher,omitempty"`
}
type RancherConfig struct {
2015-04-16 06:16:23 +00:00
Environment map[string]string `yaml:"environment,omitempty"`
2015-04-16 05:57:59 +00:00
Services map[string]*project.ServiceConfig `yaml:"services,omitempty"`
BootstrapContainers map[string]*project.ServiceConfig `yaml:"bootstrap,omitempty"`
Autoformat map[string]*project.ServiceConfig `yaml:"autoformat,omitempty"`
2015-04-03 21:59:24 +00:00
BootstrapDocker DockerConfig `yaml:"bootstrap_docker,omitempty"`
CloudInit CloudInit `yaml:"cloud_init,omitempty"`
Console ConsoleConfig `yaml:"console,omitempty"`
Debug bool `yaml:"debug,omitempty"`
Disable []string `yaml:"disable,omitempty"`
2015-04-16 05:57:59 +00:00
ServicesInclude map[string]bool `yaml:"services_include,omitempty"`
Modules []string `yaml:"modules,omitempty"`
2015-07-29 07:45:06 +00:00
Network netconf.NetworkConfig `yaml:"network,omitempty"`
2015-04-16 05:57:59 +00:00
Repositories Repositories `yaml:"repositories,omitempty"`
Ssh SshConfig `yaml:"ssh,omitempty"`
State StateConfig `yaml:"state,omitempty"`
SystemDocker DockerConfig `yaml:"system_docker,omitempty"`
Upgrade UpgradeConfig `yaml:"upgrade,omitempty"`
UserContainers []ContainerConfig `yaml:"user_containers,omitempty"`
UserDocker DockerConfig `yaml:"user_docker,omitempty"`
2015-03-15 05:21:22 +00:00
}
type ConsoleConfig struct {
2015-03-18 13:23:27 +00:00
Tail bool `yaml:"tail,omitempty"`
Persistent bool `yaml:"persistent,omitempty"`
2015-03-15 04:27:04 +00:00
}
type UpgradeConfig struct {
2015-03-19 21:57:53 +00:00
Url string `yaml:"url,omitempty"`
Image string `yaml:"image,omitempty"`
Rollback string `yaml:"rollback,omitempty"`
2015-03-15 04:27:04 +00:00
}
2015-03-18 13:23:27 +00:00
type DockerConfig struct {
TLS bool `yaml:"tls,omitempty"`
TLSArgs []string `yaml:"tls_args,flow,omitempty"`
Args []string `yaml:"args,flow,omitempty"`
2015-04-03 21:59:24 +00:00
ExtraArgs []string `yaml:"extra_args,flow,omitempty"`
2015-03-18 13:23:27 +00:00
ServerCert string `yaml:"server_cert,omitempty"`
ServerKey string `yaml:"server_key,omitempty"`
CACert string `yaml:"ca_cert,omitempty"`
CAKey string `yaml:"ca_key,omitempty"`
2015-03-15 04:27:04 +00:00
}
type SshConfig struct {
Keys map[string]string `yaml:"keys,omitempty"`
}
2015-03-18 13:23:27 +00:00
type StateConfig struct {
FsType string `yaml:"fstype,omitempty"`
Dev string `yaml:"dev,omitempty"`
Required bool `yaml:"required,omitempty"`
Autoformat []string `yaml:"autoformat,omitempty"`
FormatZero bool `yaml:"formatzero,omitempty"`
2015-03-15 04:27:04 +00:00
}
type CloudInit struct {
Datasources []string `yaml:"datasources,omitempty"`
}
2015-03-20 18:35:21 +00:00
func init() {
if VERSION == "" {
VERSION = "v0.0.0-dev"
}
}