Feature 57 (config and provisioning): modules declare config and provisions, their files rendered from templates; synced with main (issues of feature 57, 874)
This commit is contained in:
@@ -79,6 +79,26 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"site": {
|
||||
"type": "string",
|
||||
"description": "The UniFi site the module's tools act on, by its id; the file's default is default.",
|
||||
"trusted": true,
|
||||
"default": "default"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "The address the module's tools reach the UniFi controller at, as a URL; unset, the code falls back to its environment, else this machine's controller on its HTTPS port.",
|
||||
"trusted": true,
|
||||
"default": ""
|
||||
},
|
||||
"username": {
|
||||
"type": "string",
|
||||
"description": "The UniFi account the module's tools sign in as with the vault's password; unset, the code falls back to its environment.",
|
||||
"trusted": true,
|
||||
"default": ""
|
||||
}
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"id": "mesh-state",
|
||||
@@ -130,8 +150,9 @@
|
||||
"type": "file",
|
||||
"path": "${dir:mesh-state}/config.json",
|
||||
"mode": "0600",
|
||||
"content": "{\n \"site\": \"default\",\n \"password\": \"${secret:controller}\"\n}\n",
|
||||
"template": "files/config.json",
|
||||
"merge": "json",
|
||||
"takes-config": ["site", "url", "username"],
|
||||
"protected": ["password"]
|
||||
}
|
||||
],
|
||||
@@ -168,6 +189,11 @@
|
||||
"MESH_UNIFI_URL": "https://127.0.0.1:${port:8443}",
|
||||
"MESH_UNIFI_CONFIG_FILE": "${dir:mesh-state}/config.json"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "files",
|
||||
"kind": "archive",
|
||||
"from": "files"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user