1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 23:04:41 +00:00

Refactor default configuration

This commit is contained in:
Darren Shepherd
2015-03-18 06:23:27 -07:00
parent 3756bbae90
commit 5877e586b8
3 changed files with 131 additions and 80 deletions

View File

@@ -1,9 +1,10 @@
package config
const (
VERSION = "0.0.1"
VERSION = "0.2.0-dev"
CONSOLE_CONTAINER = "console"
DOCKER_BIN = "/usr/bin/docker"
DOCKER_SYSTEM_HOME = "/var/lib/system-docker"
DOCKER_SYSTEM_HOST = "unix:///var/run/system-docker.sock"
DOCKER_HOST = "unix:///var/run/docker.sock"
IMAGES_PATH = "/"
@@ -15,6 +16,7 @@ const (
)
var (
CloudConfigFile = "/var/lib/rancher/conf/cloud-config-rancher.yml"
ConfigFile = "/var/lib/rancher/conf/rancher.yml"
PrivateConfigFile = "/var/lib/rancher/conf/rancher-private.yml"
)
@@ -27,39 +29,43 @@ type ContainerConfig struct {
}
type Config struct {
Debug bool `yaml:"debug,omitempty"`
Disable []string `yaml:"disable,omitempty"`
Dns []string `yaml:"dns,flow,omitempty"`
//Rescue bool `yaml:"rescue,omitempty"`
//RescueContainer *ContainerConfig `yaml:"rescue_container,omitempty"`
Console ConsoleConfig `yaml:"console,omitempty"`
State ConfigState `yaml:"state,omitempty"`
Userdocker UserDockerConfig `yaml:"userdocker,omitempty"`
Upgrade UpgradeConfig `yaml:"upgrade,omitempty"`
BootstrapContainers []ContainerConfig `yaml:"bootstrap_containers,omitempty"`
SystemContainers []ContainerConfig `yaml:"system_containers,omitempty"`
UserContainers []ContainerConfig `yaml:"user_containers,omitempty"`
SystemDockerArgs []string `yaml:"system_docker_args,flow,omitempty"`
Modules []string `yaml:"modules,omitempty"`
CloudInit CloudInit `yaml:"cloud_init,omitempty"`
Ssh SshConfig `yaml:"ssh,omitempty"`
EnabledAddons []string `yaml:"enabled_addons,omitempty"`
Addons map[string]Config `yaml:"addons,omitempty"`
BootstrapContainers []ContainerConfig `yaml:"bootstrap_containers,omitempty"`
CloudInit CloudInit `yaml:"cloud_init,omitempty"`
Console ConsoleConfig `yaml:"console,omitempty"`
Debug bool `yaml:"debug,omitempty"`
Disable []string `yaml:"disable,omitempty"`
EnabledAddons []string `yaml:"enabled_addons,omitempty"`
Modules []string `yaml:"modules,omitempty"`
Network NetworkConfig `yaml:"network,omitempty"`
Ssh SshConfig `yaml:"ssh,omitempty"`
State StateConfig `yaml:"state,omitempty"`
SystemContainers []ContainerConfig `yaml:"system_containers,omitempty"`
SystemDocker DockerConfig `yaml:"system_docker,omitempty"`
Upgrade UpgradeConfig `yaml:"upgrade,omitempty"`
UserContainers []ContainerConfig `yaml:"user_containers,omitempty"`
UserDocker DockerConfig `yaml:"user_docker,omitempty"`
}
type ConsoleConfig struct {
Tail bool `yaml:"tail,omitempty"`
Ephemeral bool `yaml:"ephemeral,omitempty"`
Tail bool `yaml:"tail,omitempty"`
Persistent bool `yaml:"persistent,omitempty"`
}
type UpgradeConfig struct {
Url string `yaml:"url,omitempty"`
}
type DnsConfig struct {
Nameservers []string `yaml:"nameservers,flow,omitempty"`
Search []string `yaml:"search,flow,omitempty"`
Domain string `yaml:"domain,omitempty"`
}
type NetworkConfig struct {
Interfaces []InterfaceConfig `yaml:"interfaces,omitempty"`
PostRun *ContainerConfig `yaml:"post_run,omitempty"`
Dns DnsConfig `yaml:"dns,omitempty"`
Interfaces map[string]InterfaceConfig `yaml:"interfaces,omitempty"`
PostRun *ContainerConfig `yaml:"post_run,omitempty"`
}
type InterfaceConfig struct {
@@ -70,21 +76,25 @@ type InterfaceConfig struct {
MTU int `yaml:"mtu,omitempty"`
}
type UserDockerConfig struct {
UseTLS bool `yaml:"use_tls,omitempty"`
TLSServerCert string `yaml:"tls_server_cert,omitempty"`
TLSServerKey string `yaml:"tls_server_key,omitempty"`
TLSCACert string `yaml:"tls_ca_cert,omitempty"`
type DockerConfig struct {
TLS bool `yaml:"tls,omitempty"`
TLSArgs []string `yaml:"tls_args,flow,omitempty"`
Args []string `yaml:"args,flow,omitempty"`
ServerCert string `yaml:"server_cert,omitempty"`
ServerKey string `yaml:"server_key,omitempty"`
CACert string `yaml:"ca_cert,omitempty"`
CAKey string `yaml:"ca_key,omitempty"`
}
type SshConfig struct {
Keys map[string]string `yaml:"keys,omitempty"`
}
type ConfigState struct {
FsType string `yaml:"fstype,omitempty"`
Dev string `yaml:"dev,omitempty"`
Required bool `yaml:"required,omitempty"`
type StateConfig struct {
FsType string `yaml:"fstype,omitempty"`
Dev string `yaml:"dev,omitempty"`
Required bool `yaml:"required,omitempty"`
Autoformat []string `yaml:"autoformat,omitempty"`
}
type CloudInit struct {