forked from clan/clan-core
Inventory: add concrete use-case examples
This commit is contained in:
parent
6c11e0ced7
commit
afdfa6181b
@ -1,20 +1,8 @@
|
|||||||
package machines
|
package machines
|
||||||
|
|
||||||
#ServiceRole: "server" | "client" | "both"
|
|
||||||
|
|
||||||
#machine: machines: [string]: {
|
#machine: machines: [string]: {
|
||||||
name: string,
|
name: string,
|
||||||
description?: string,
|
description?: string,
|
||||||
icon?: string,
|
icon?: string
|
||||||
// each machines service
|
|
||||||
services?: [string]: {
|
|
||||||
// Roles if specificed must contain one or more roles
|
|
||||||
// If no roles are specified, the service module defines the default roles.
|
|
||||||
roles?: [ ...#ServiceRole ],
|
|
||||||
// The service config to use
|
|
||||||
// This config is scoped to the service.module, only serializable data (strings,numbers, etc) can be assigned here
|
|
||||||
config: {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,5 +1,7 @@
|
|||||||
package services
|
package services
|
||||||
|
|
||||||
|
#ServiceRole: "server" | "client" | "both"
|
||||||
|
|
||||||
#service: services: [string]: {
|
#service: services: [string]: {
|
||||||
// Required meta fields
|
// Required meta fields
|
||||||
meta: {
|
meta: {
|
||||||
@ -12,14 +14,14 @@ package services
|
|||||||
|
|
||||||
// We moved the machine sepcific config to "machines".
|
// We moved the machine sepcific config to "machines".
|
||||||
// It may be moved back depending on what makes more sense in the future.
|
// It may be moved back depending on what makes more sense in the future.
|
||||||
// machineConfig: {
|
machineConfig: {
|
||||||
// [string]: {
|
[string]: {
|
||||||
// roles: string[],
|
roles?: [ ...#ServiceRole ],
|
||||||
// config: {
|
config?: {
|
||||||
// defaultUser?: string
|
...
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
|
|
||||||
// Configuration for the service
|
// Configuration for the service
|
||||||
config: {
|
config: {
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
"machines": {
|
|
||||||
"jon_machine": {
|
|
||||||
"name": "jon",
|
|
||||||
"description": "Jon's machine",
|
|
||||||
"icon": "assets/icon.png",
|
|
||||||
"services": {
|
|
||||||
"matrix": {
|
|
||||||
"roles": ["server"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"anna_machine": {
|
|
||||||
"name": "anna",
|
|
||||||
"description": "anna's machine"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"meta": {
|
|
||||||
"name": "clan name"
|
|
||||||
},
|
|
||||||
"services": {
|
|
||||||
"sync-home": {
|
|
||||||
"meta": {
|
|
||||||
"name": "My Home Sync"
|
|
||||||
},
|
|
||||||
"module": "syncthing",
|
|
||||||
"config": {
|
|
||||||
"folders": ["/sync/my_f"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"matrix": {
|
|
||||||
"meta": {
|
|
||||||
"name": "Our matrix chat",
|
|
||||||
"description": "Matrix chat service for our clan"
|
|
||||||
},
|
|
||||||
"module": "matrix-synapse",
|
|
||||||
"config": {
|
|
||||||
"compression": "zstd"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"backup": {
|
|
||||||
"meta": {
|
|
||||||
"name": "My daily backup"
|
|
||||||
},
|
|
||||||
"module": "borgbackup",
|
|
||||||
"config": {}
|
|
||||||
},
|
|
||||||
"borgbackup_1": {
|
|
||||||
"meta": {
|
|
||||||
"name": "My weekly backup"
|
|
||||||
},
|
|
||||||
"module": "borgbackup",
|
|
||||||
"config": {
|
|
||||||
"compression": "lz4"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
38
inventory/src/tests/borgbackup.json
Normal file
38
inventory/src/tests/borgbackup.json
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"machines": {
|
||||||
|
"camina_machine": {
|
||||||
|
"name": "camina"
|
||||||
|
},
|
||||||
|
"vyr_machine": {
|
||||||
|
"name": "vyr"
|
||||||
|
},
|
||||||
|
"vi_machine": {
|
||||||
|
"name": "vi"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"name": "kenjis clan"
|
||||||
|
},
|
||||||
|
"services": {
|
||||||
|
"backup": {
|
||||||
|
"meta": {
|
||||||
|
"name": "My backup"
|
||||||
|
},
|
||||||
|
"module": "borbackup-static",
|
||||||
|
"machineConfig": {
|
||||||
|
"vyr": {
|
||||||
|
"roles": ["server"]
|
||||||
|
},
|
||||||
|
"vi": {
|
||||||
|
"roles": ["client"]
|
||||||
|
},
|
||||||
|
"camina_machine": {
|
||||||
|
"roles": ["client"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"folders": ["/home", "/root", "/var", "/etc"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
45
inventory/src/tests/syncthing.json
Normal file
45
inventory/src/tests/syncthing.json
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"machines": {
|
||||||
|
"camina_machine": {
|
||||||
|
"name": "camina"
|
||||||
|
},
|
||||||
|
"vyr": {
|
||||||
|
"name": "vyr"
|
||||||
|
},
|
||||||
|
"vi": {
|
||||||
|
"name": "vi"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"name": "kenjis clan"
|
||||||
|
},
|
||||||
|
"services": {
|
||||||
|
"sync_files": {
|
||||||
|
"meta": {
|
||||||
|
"name": "My sync"
|
||||||
|
},
|
||||||
|
"module": "syncthing-static-peers",
|
||||||
|
"machineConfig": {
|
||||||
|
"vyr": {},
|
||||||
|
"vi": {},
|
||||||
|
"camina_machine": {}
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"folders": {
|
||||||
|
"test": {
|
||||||
|
"path": "~/data/docs",
|
||||||
|
"devices": ["camina", "vyr", "vi"]
|
||||||
|
},
|
||||||
|
"videos": {
|
||||||
|
"path": "~/data/videos",
|
||||||
|
"devices": ["camina", "vyr", "ezra"]
|
||||||
|
},
|
||||||
|
"playlist": {
|
||||||
|
"path": "~/data/playlist",
|
||||||
|
"devices": ["camina", "vyr", "ezra"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
36
inventory/src/tests/zerotier.json
Normal file
36
inventory/src/tests/zerotier.json
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"machines": {
|
||||||
|
"camina_machine": {
|
||||||
|
"name": "camina"
|
||||||
|
},
|
||||||
|
"vyr_machine": {
|
||||||
|
"name": "vyr"
|
||||||
|
},
|
||||||
|
"vi_machine": {
|
||||||
|
"name": "vi"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"name": "kenjis clan"
|
||||||
|
},
|
||||||
|
"services": {
|
||||||
|
"backup": {
|
||||||
|
"meta": {
|
||||||
|
"name": "My backup"
|
||||||
|
},
|
||||||
|
"module": "borbackup-static",
|
||||||
|
"machineConfig": {
|
||||||
|
"vyr_machine": {
|
||||||
|
"roles": ["server"]
|
||||||
|
},
|
||||||
|
"vi_machine": {
|
||||||
|
"roles": ["peer"]
|
||||||
|
},
|
||||||
|
"camina_machine": {
|
||||||
|
"roles": ["peer"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"config": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user