@highstate/proxmox 0.4.1 → 0.4.2

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.
@@ -0,0 +1,21 @@
1
+ import { proxmox } from '@highstate/library';
2
+ import { forUnit, output } from '@highstate/pulumi';
3
+ import { cluster } from '@muhlba91/pulumi-proxmoxve';
4
+ import { c as createProvider } from '../provider-QSzoFScT.js';
5
+
6
+ const { args, secrets, outputs } = forUnit(proxmox.connection);
7
+ const proxmoxCluster = output({
8
+ endpoint: args.endpoint,
9
+ insecure: args.insecure,
10
+ username: args.username,
11
+ defaultNodeName: args.defaultNodeName,
12
+ password: secrets.password,
13
+ apiToken: secrets.apiToken
14
+ });
15
+ const provider = createProvider(proxmoxCluster);
16
+ await cluster.getNodes({ provider });
17
+ var index = outputs({
18
+ proxmoxCluster
19
+ });
20
+
21
+ export { index as default };
File without changes
@@ -1,7 +1,7 @@
1
1
  import { proxmox } from '@highstate/library';
2
2
  import { forUnit, output } from '@highstate/pulumi';
3
3
  import { download } from '@muhlba91/pulumi-proxmoxve';
4
- import { c as createProvider } from '../provider-DyXtZ5E3.mjs';
4
+ import { c as createProvider } from '../provider-QSzoFScT.js';
5
5
 
6
6
  const { name, args, inputs, outputs } = forUnit(proxmox.image);
7
7
  const file = new download.File(
@@ -8,7 +8,7 @@ function createProvider(cluster) {
8
8
  insecure: cluster.insecure?.apply((x) => x ?? false),
9
9
  username: cluster.username?.apply((x) => x ?? ""),
10
10
  password: cluster.password?.apply((x) => x ?? ""),
11
- apiToken: cluster.apiToken?.apply((x) => x ?? "")
11
+ apiToken: cluster.apiToken?.apply((x) => x ?? undefined)
12
12
  });
13
13
  }
14
14
 
@@ -1,7 +1,7 @@
1
1
  import { proxmox } from '@highstate/library';
2
2
  import { forUnit } from '@highstate/pulumi';
3
3
  import { vm } from '@muhlba91/pulumi-proxmoxve';
4
- import { c as createProvider } from '../provider-DyXtZ5E3.mjs';
4
+ import { c as createProvider } from '../provider-QSzoFScT.js';
5
5
 
6
6
  const { name, args, inputs, outputs } = forUnit(proxmox.virtualMachine);
7
7
  const machine = new vm.VirtualMachine(
@@ -29,7 +29,7 @@ const machine = new vm.VirtualMachine(
29
29
  {
30
30
  interface: "scsi0",
31
31
  size: args.diskSize,
32
- datastoreId: args.datastoreId
32
+ datastoreId: args.datastoreId ?? inputs.proxmoxCluster.defaultDatastoreId?.apply((id) => id ?? "") ?? ""
33
33
  }
34
34
  ],
35
35
  networkDevices: [
@@ -48,7 +48,7 @@ function findNotLocalHostIpV4(ips) {
48
48
  return ip[0];
49
49
  }
50
50
  }
51
- return;
51
+ throw new Error("No non-local host IP found");
52
52
  }
53
53
  function deriveIpV4Gateway(ip) {
54
54
  return ip.split(".").slice(0, 3).join(".") + ".1";
@@ -64,19 +64,17 @@ function createCloudInit(resolvedInputs) {
64
64
  gateway: args.ipv4Gateway ?? deriveIpV4Gateway(args.ipv4)
65
65
  }
66
66
  }
67
- ] : void 0,
68
- dns: args.dns ? { servers: args.dns } : void 0,
67
+ ] : undefined,
68
+ dns: args.dns ? { servers: args.dns } : undefined,
69
69
  userAccount: resolvedInputs.sshPublicKey ? {
70
70
  keys: [resolvedInputs.sshPublicKey.publicKey]
71
- } : void 0
71
+ } : undefined
72
72
  };
73
73
  }
74
74
  var index = outputs({
75
75
  server: {
76
76
  endpoint: machine.ipv4Addresses.apply(findNotLocalHostIpV4),
77
- sshCredentials: {
78
- privateKey: inputs.sshKeyPair
79
- }
77
+ hostname: name
80
78
  }
81
79
  });
82
80
 
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@highstate/proxmox",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "exports": {
9
- "./connection": "./dist/connection/index.mjs",
10
- "./virtual-machine": "./dist/virtual-machine/index.mjs",
11
- "./existing-image": "./dist/existing-image/index.mjs",
12
- "./image": "./dist/image/index.mjs"
9
+ "./connection": "./dist/connection/index.js",
10
+ "./virtual-machine": "./dist/virtual-machine/index.js",
11
+ "./existing-image": "./dist/existing-image/index.js",
12
+ "./image": "./dist/image/index.js"
13
13
  },
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
17
  "scripts": {
18
- "build": "pkgroll --clean-dist"
18
+ "build": "pkgroll --tsconfig=tsconfig.build.json"
19
19
  },
20
20
  "dependencies": {
21
- "@highstate/pulumi": "^0.4.1",
21
+ "@highstate/pulumi": "^0.4.2",
22
22
  "@muhlba91/pulumi-proxmoxve": "^6.17.1"
23
23
  },
24
24
  "peerDependencies": {
@@ -27,5 +27,5 @@
27
27
  "devDependencies": {
28
28
  "pkgroll": "^2.5.1"
29
29
  },
30
- "gitHead": "0ebd5c9d6f0176a38e8786d239a0b0828fa635f0"
30
+ "gitHead": "e88c7c588267cf028c054f694d402902dc057919"
31
31
  }
@@ -1,16 +0,0 @@
1
- import { proxmox } from '@highstate/library';
2
- import { forUnit } from '@highstate/pulumi';
3
-
4
- const { args, secrets, outputs } = forUnit(proxmox.connection);
5
- var index = outputs({
6
- proxmoxCluster: {
7
- endpoint: args.endpoint,
8
- insecure: args.insecure,
9
- username: args.username,
10
- defaultNodeName: args.defaultNodeName,
11
- password: secrets.password,
12
- apiToken: secrets.apiToken
13
- }
14
- });
15
-
16
- export { index as default };