@celilo/cli 0.5.0-alpha.10 → 0.5.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -33,7 +33,12 @@ import { FuelGauge } from '../fuel-gauge';
|
|
|
33
33
|
|
|
34
34
|
const UBUNTU_2404_AMD64_URL =
|
|
35
35
|
'https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img';
|
|
36
|
-
|
|
36
|
+
// Stored under the storage's import/ namespace, so the filename must end in an
|
|
37
|
+
// extension PVE accepts for `import` content (UPLOAD_IMPORT_EXT_RE_1 =
|
|
38
|
+
// ova|qcow2|raw|vmdk) — a `.img` is rejected with "invalid filename or wrong
|
|
39
|
+
// extension". Ubuntu's cloud image is qcow2 format despite the upstream `.img`
|
|
40
|
+
// URL, so we download it under a `.qcow2` name. The URL above is unchanged.
|
|
41
|
+
const UBUNTU_2404_AMD64_FILENAME = 'noble-server-cloudimg-amd64.qcow2';
|
|
37
42
|
const DEFAULT_TEMPLATE_NAME = 'ubuntu-2404-cloudinit';
|
|
38
43
|
|
|
39
44
|
export interface VmTemplateBuildParams {
|
|
@@ -745,6 +745,10 @@ export async function generateTemplates(options: GenerateOptions): Promise<Gener
|
|
|
745
745
|
default_target_node: string;
|
|
746
746
|
lxc_template: string;
|
|
747
747
|
storage: string;
|
|
748
|
+
// Optional: only set once a cloud-init VM template has been built/selected
|
|
749
|
+
// for the service (see service reconfigure). Required by `type: vm` modules;
|
|
750
|
+
// absent for services that only deploy LXCs.
|
|
751
|
+
vm_template?: string;
|
|
748
752
|
};
|
|
749
753
|
|
|
750
754
|
// ISS-0090: deploy follows REALITY. Resolve the node from Proxmox (it sees
|
|
@@ -774,6 +778,13 @@ export async function generateTemplates(options: GenerateOptions): Promise<Gener
|
|
|
774
778
|
// any stale __infra_target_node a prior generate left behind.
|
|
775
779
|
upsertModuleConfig(db, moduleId, '__infra_lxc_template', providerConfig.lxc_template);
|
|
776
780
|
upsertModuleConfig(db, moduleId, '__infra_storage', providerConfig.storage);
|
|
781
|
+
// vm_template is only present once a VM template exists for the service.
|
|
782
|
+
// Persist it when set so `type: vm` modules can resolve $self:vm_template;
|
|
783
|
+
// a `type: vm` deploy against a service without one then fails loudly at
|
|
784
|
+
// variable resolution (the intended "no VM template configured" error).
|
|
785
|
+
if (providerConfig.vm_template) {
|
|
786
|
+
upsertModuleConfig(db, moduleId, '__infra_vm_template', providerConfig.vm_template);
|
|
787
|
+
}
|
|
777
788
|
deleteModuleConfig(db, moduleId, '__infra_target_node');
|
|
778
789
|
|
|
779
790
|
log.success(`Infrastructure resolved: target_node=${decision.node} (${decision.source})`);
|
|
@@ -816,7 +827,7 @@ export async function generateTemplates(options: GenerateOptions): Promise<Gener
|
|
|
816
827
|
|
|
817
828
|
// lxc_template / storage are provider config (intent, not drift-prone) — read
|
|
818
829
|
// them back from the __infra_* rows persisted above.
|
|
819
|
-
const infraKeys = ['lxc_template', 'storage'];
|
|
830
|
+
const infraKeys = ['lxc_template', 'storage', 'vm_template'];
|
|
820
831
|
for (const key of infraKeys) {
|
|
821
832
|
const infraConfig = db
|
|
822
833
|
.select()
|