@highstate/proxmox 0.9.13 → 0.9.15
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.
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"sourceHashes": {
|
3
|
-
"./dist/connection/index.js": "
|
4
|
-
"./dist/virtual-machine/index.js": "
|
5
|
-
"./dist/existing-image/index.js": "
|
6
|
-
"./dist/image/index.js": "
|
3
|
+
"./dist/connection/index.js": "fdf33c83036749acc45a0903c0d865a6cd8d7de8fcc828ff3f16892b480cb550",
|
4
|
+
"./dist/virtual-machine/index.js": "a4895f2b80425324adb3164fd4b917b086aaa6ba472ed3ca868f81625100730f",
|
5
|
+
"./dist/existing-image/index.js": "c5e5e9d1324515b31e8ed33b59b696fb225c0bd6a07ac55538a41e757d84be34",
|
6
|
+
"./dist/image/index.js": "1736f8f8fd5d033db5ab6a7a5c578ce911980806fed9825b208061ee7ec42c12"
|
7
7
|
}
|
8
8
|
}
|
@@ -16,6 +16,7 @@ var { name, args, inputs, secrets, outputs } = forUnit(proxmox.virtualMachine);
|
|
16
16
|
var provider = await createProvider(inputs.proxmoxCluster);
|
17
17
|
var nodeName = args.nodeName ?? inputs.proxmoxCluster.defaultNodeName;
|
18
18
|
var datastoreId = args.datastoreId ?? inputs.proxmoxCluster.defaultDatastoreId;
|
19
|
+
var sshKeyPair = await toPromise(inputs.sshKeyPair);
|
19
20
|
var machine = new vm.VirtualMachine(
|
20
21
|
name,
|
21
22
|
{
|
@@ -32,11 +33,6 @@ var machine = new vm.VirtualMachine(
|
|
32
33
|
memory: {
|
33
34
|
dedicated: args.memory
|
34
35
|
},
|
35
|
-
// cdrom: {
|
36
|
-
// enabled: true,
|
37
|
-
// interface: "ide1",
|
38
|
-
// fileId: inputs.image.id,
|
39
|
-
// },
|
40
36
|
disks: [
|
41
37
|
{
|
42
38
|
interface: "virtio0",
|
@@ -53,9 +49,8 @@ var machine = new vm.VirtualMachine(
|
|
53
49
|
}
|
54
50
|
],
|
55
51
|
initialization: output(inputs).apply(createCloudInit)
|
56
|
-
// bootOrders: ["scsi0", "ide1"],
|
57
52
|
},
|
58
|
-
{ provider, ignoreChanges: ["disks"] }
|
53
|
+
{ provider, ignoreChanges: ["disks", "cdrom"] }
|
59
54
|
);
|
60
55
|
function findNotLocalHostIpV4(ips) {
|
61
56
|
for (const ip of ips) {
|
@@ -112,7 +107,8 @@ var server = createServerEntity(
|
|
112
107
|
args.sshPort,
|
113
108
|
args.sshUser,
|
114
109
|
secrets.sshPassword,
|
115
|
-
inputs.sshKeyPair?.privateKey
|
110
|
+
inputs.sshKeyPair?.privateKey,
|
111
|
+
!!sshKeyPair
|
116
112
|
);
|
117
113
|
var virtual_machine_default = outputs({
|
118
114
|
server,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/virtual-machine/index.ts"],"sourcesContent":["import type { VM } from \"@muhlba91/pulumi-proxmoxve/types/input\"\nimport { proxmox } from \"@highstate/library\"\nimport { forUnit, output, toPromise, type Input, type Unwrap } from \"@highstate/pulumi\"\nimport { vm, storage } from \"@muhlba91/pulumi-proxmoxve\"\nimport {\n createServerEntity,\n createSshTerminal,\n l3EndpointToString,\n parseL3Endpoint,\n} from \"@highstate/common\"\nimport { createProvider } from \"../provider\"\n\nconst { name, args, inputs, secrets, outputs } = forUnit(proxmox.virtualMachine)\n\nconst provider = await createProvider(inputs.proxmoxCluster)\n\nconst nodeName = args.nodeName ?? inputs.proxmoxCluster.defaultNodeName\nconst datastoreId = args.datastoreId ?? inputs.proxmoxCluster.defaultDatastoreId\n\nconst machine = new vm.VirtualMachine(\n name,\n {\n name,\n nodeName,\n agent: {\n enabled: true,\n },\n cpu: {\n cores: args.cores,\n sockets: args.sockets,\n type: args.cpuType,\n },\n memory: {\n dedicated: args.memory,\n },\n
|
1
|
+
{"version":3,"sources":["../../src/virtual-machine/index.ts"],"sourcesContent":["import type { VM } from \"@muhlba91/pulumi-proxmoxve/types/input\"\nimport { proxmox } from \"@highstate/library\"\nimport { forUnit, output, toPromise, type Input, type Unwrap } from \"@highstate/pulumi\"\nimport { vm, storage } from \"@muhlba91/pulumi-proxmoxve\"\nimport {\n createServerEntity,\n createSshTerminal,\n l3EndpointToString,\n parseL3Endpoint,\n} from \"@highstate/common\"\nimport { createProvider } from \"../provider\"\n\nconst { name, args, inputs, secrets, outputs } = forUnit(proxmox.virtualMachine)\n\nconst provider = await createProvider(inputs.proxmoxCluster)\n\nconst nodeName = args.nodeName ?? inputs.proxmoxCluster.defaultNodeName\nconst datastoreId = args.datastoreId ?? inputs.proxmoxCluster.defaultDatastoreId\nconst sshKeyPair = await toPromise(inputs.sshKeyPair)\n\nconst machine = new vm.VirtualMachine(\n name,\n {\n name,\n nodeName,\n agent: {\n enabled: true,\n },\n cpu: {\n cores: args.cores,\n sockets: args.sockets,\n type: args.cpuType,\n },\n memory: {\n dedicated: args.memory,\n },\n disks: [\n {\n interface: \"virtio0\",\n size: args.diskSize,\n iothread: true,\n discard: \"on\",\n datastoreId,\n fileId: inputs.image.id,\n },\n ],\n networkDevices: [\n {\n bridge: args.bridge,\n },\n ],\n initialization: output(inputs).apply(createCloudInit),\n },\n { provider, ignoreChanges: [\"disks\", \"cdrom\"] },\n)\n\nfunction findNotLocalHostIpV4(ips: string[][]): string {\n for (const ip of ips) {\n if (ip[0] && ip[0] !== \"127.0.0.1\") {\n return ip[0]\n }\n }\n\n throw new Error(\"No non-local host IP found\")\n}\n\nfunction deriveIpV4Gateway(ip: string): string {\n return ip.split(\".\").slice(0, 3).join(\".\") + \".1\"\n}\n\nfunction createCloudInit(resolvedInputs: Unwrap<typeof inputs>): VM.VirtualMachineInitialization {\n let vendorDataFileId: Input<string> | undefined\n\n if (args.vendorData) {\n const file = new storage.File(\n \"vendor-data\",\n {\n datastoreId,\n nodeName,\n contentType: \"snippets\",\n sourceRaw: { fileName: `${name}-vendor-data.yaml`, data: args.vendorData },\n },\n { provider },\n )\n\n vendorDataFileId = file.id\n }\n\n return {\n datastoreId,\n interface: \"ide2\",\n ipConfigs: args.ipv4\n ? [\n {\n ipv4: {\n address: args.ipv4,\n gateway: args.ipv4Gateway ?? deriveIpV4Gateway(args.ipv4),\n },\n },\n ]\n : undefined,\n dns: args.dns ? { servers: args.dns } : undefined,\n\n userAccount: resolvedInputs.sshKeyPair\n ? output({\n keys: [resolvedInputs.sshKeyPair.publicKey],\n username: args.sshUser ?? \"root\",\n password: secrets.sshPassword,\n })\n : undefined,\n\n vendorDataFileId,\n }\n}\n\nconst ipv4Addresses = await toPromise(machine.ipv4Addresses)\nconst nonLocalHostIpV4 = findNotLocalHostIpV4(ipv4Addresses)\n\nconst endpoint = parseL3Endpoint(nonLocalHostIpV4)\n\nconst server = createServerEntity(\n name,\n endpoint,\n args.sshPort,\n args.sshUser,\n secrets.sshPassword,\n inputs.sshKeyPair?.privateKey,\n !!sshKeyPair,\n)\n\nexport default outputs({\n server,\n endpoints: [endpoint],\n\n $status: {\n endpoints: [l3EndpointToString(endpoint)],\n hostname: name,\n },\n\n $terminals: [createSshTerminal(server.ssh)],\n})\n"],"mappings":";;;;;AACA,SAAS,eAAe;AACxB,SAAS,SAAS,QAAQ,iBAA0C;AACpE,SAAS,IAAI,eAAe;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,EAAE,MAAM,MAAM,QAAQ,SAAS,QAAQ,IAAI,QAAQ,QAAQ,cAAc;AAE/E,IAAM,WAAW,MAAM,eAAe,OAAO,cAAc;AAE3D,IAAM,WAAW,KAAK,YAAY,OAAO,eAAe;AACxD,IAAM,cAAc,KAAK,eAAe,OAAO,eAAe;AAC9D,IAAM,aAAa,MAAM,UAAU,OAAO,UAAU;AAEpD,IAAM,UAAU,IAAI,GAAG;AAAA,EACrB;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,IACA,KAAK;AAAA,MACH,OAAO,K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,eAAe,kBAAkB,KAAK,IAAI;AAAA,QAC1D;AAAA,MACF;AAAA,IACF,IACA;AAAA,IACJ,KAAK,KAAK,MAAM,EAAE,SAAS,KAAK,IAAI,IAAI;AAAA,IAExC,aAAa,eAAe,aACxB,OAAO;AAAA,MACL,MAAM,CAAC,eAAe,WAAW,SAAS;AAAA,MAC1C,UAAU,KAAK,WAAW;AAAA,MAC1B,UAAU,QAAQ;AAAA,IACpB,CAAC,IACD;AAAA,IAEJ;AAAA,EACF;AACF;AAEA,IAAM,gBAAgB,MAAM,UAAU,QAAQ,aAAa;AAC3D,IAAM,mBAAmB,qBAAqB,aAAa;AAE3D,IAAM,WAAW,gBAAgB,gBAAgB;AAEjD,IAAM,SAAS;AAAA,EACb;AAAA,EACA;AAAA,EACA,KAAK;AAAA,EACL,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO,YAAY;AAAA,EACnB,CAAC,CAAC;AACJ;AAEA,IAAO,0BAAQ,QAAQ;AAAA,EACrB;AAAA,EACA,WAAW,CAAC,QAAQ;AAAA,EAEpB,SAAS;AAAA,IACP,WAAW,CAAC,mBAAmB,QAAQ,CAAC;AAAA,IACxC,UAAU;AAAA,EACZ;AAAA,EAEA,YAAY,CAAC,kBAAkB,OAAO,GAAG,CAAC;AAC5C,CAAC;","names":[]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@highstate/proxmox",
|
3
|
-
"version": "0.9.
|
3
|
+
"version": "0.9.15",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -18,14 +18,14 @@
|
|
18
18
|
"build": "highstate build"
|
19
19
|
},
|
20
20
|
"dependencies": {
|
21
|
-
"@highstate/common": "^0.9.
|
22
|
-
"@highstate/contract": "^0.9.
|
23
|
-
"@highstate/library": "^0.9.
|
24
|
-
"@highstate/pulumi": "^0.9.
|
21
|
+
"@highstate/common": "^0.9.15",
|
22
|
+
"@highstate/contract": "^0.9.15",
|
23
|
+
"@highstate/library": "^0.9.15",
|
24
|
+
"@highstate/pulumi": "^0.9.15",
|
25
25
|
"@muhlba91/pulumi-proxmoxve": "^6.17.1"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
|
-
"@highstate/cli": "^0.9.
|
28
|
+
"@highstate/cli": "^0.9.15"
|
29
29
|
},
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "f61b9905d4cd50511b03331411f42595403ebc06"
|
31
31
|
}
|