@highstate/proxmox 0.6.2 → 0.7.0

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,9 +1,10 @@
1
1
  import { proxmox } from '@highstate/library';
2
- import { forUnit, output, interpolate } from '@highstate/pulumi';
2
+ import { forUnit, output } from '@highstate/pulumi';
3
3
  import { vm } from '@muhlba91/pulumi-proxmoxve';
4
+ import { createSshTerminal } from '@highstate/common';
4
5
  import { c as createProvider } from '../provider-BgV8Lmo6.js';
5
6
 
6
- const { name, args, inputs, outputs } = forUnit(proxmox.virtualMachine);
7
+ const { name, args, inputs, secrets, outputs } = forUnit(proxmox.virtualMachine);
7
8
  const provider = await createProvider(inputs.proxmoxCluster);
8
9
  const nodeName = args.nodeName ?? inputs.proxmoxCluster.defaultNodeName;
9
10
  const datastoreId = args.datastoreId ?? inputs.proxmoxCluster.defaultDatastoreId;
@@ -69,21 +70,24 @@ function createCloudInit(resolvedInputs) {
69
70
  }
70
71
  ] : void 0,
71
72
  dns: args.dns ? { servers: args.dns } : void 0,
72
- userAccount: resolvedInputs.sshKeyPair ? {
73
+ userAccount: resolvedInputs.sshKeyPair ? output({
73
74
  keys: [resolvedInputs.sshKeyPair.publicKey],
74
- username: args.sshUser ?? "root"
75
- } : void 0
75
+ username: args.sshUser ?? "root",
76
+ password: secrets.sshPassword
77
+ }) : void 0
76
78
  };
77
79
  }
78
80
  const endpoint = machine.ipv4Addresses.apply(findNotLocalHostIpV4);
81
+ const server = output({
82
+ endpoint,
83
+ hostname: name,
84
+ sshCredentials: {
85
+ privateKey: inputs.sshKeyPair?.privateKey,
86
+ user: args.sshUser ?? "root"
87
+ }
88
+ });
79
89
  var index = outputs({
80
- server: {
81
- endpoint,
82
- hostname: name,
83
- sshCredentials: {
84
- keyPair: inputs.sshKeyPair
85
- }
86
- },
90
+ server,
87
91
  $status: {
88
92
  endpoint: {
89
93
  value: endpoint
@@ -93,27 +97,7 @@ var index = outputs({
93
97
  }
94
98
  },
95
99
  $terminals: {
96
- ssh: {
97
- title: "SSH",
98
- image: "ghcr.io/exeteres/highstate/terminal-ssh",
99
- command: [
100
- "sshpass",
101
- "-f",
102
- "/password",
103
- "ssh",
104
- "-tt",
105
- "-o",
106
- "StrictHostKeyChecking=no",
107
- "-p",
108
- // port.toString(),
109
- "22",
110
- // `${user}@${args.endpoint}`,
111
- interpolate`root@${endpoint}`
112
- ],
113
- files: {
114
- // "/password": secrets.sshPassword?.apply(x => x ?? "") ?? "",
115
- }
116
- }
100
+ ssh: server.apply(createSshTerminal)
117
101
  }
118
102
  });
119
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/proxmox",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -18,7 +18,9 @@
18
18
  "build": "pkgroll --tsconfig=tsconfig.build.json"
19
19
  },
20
20
  "dependencies": {
21
- "@highstate/pulumi": "^0.6.2",
21
+ "@highstate/common": "^0.7.0",
22
+ "@highstate/contract": "^0.7.0",
23
+ "@highstate/pulumi": "^0.7.0",
22
24
  "@muhlba91/pulumi-proxmoxve": "^6.17.1"
23
25
  },
24
26
  "peerDependencies": {
@@ -27,5 +29,5 @@
27
29
  "devDependencies": {
28
30
  "pkgroll": "^2.5.1"
29
31
  },
30
- "gitHead": "dfd1d6878fc7d12954b6591d5ee1783d3c501eca"
32
+ "gitHead": "2f5227f7b88cf38946e490fc4cdb96127bd8b174"
31
33
  }