pmcf 2.42.0 → 2.43.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.
- package/package.json +1 -1
- package/src/host.mjs +24 -5
- package/types/host.d.mts +1 -0
package/package.json
CHANGED
package/src/host.mjs
CHANGED
|
@@ -119,6 +119,8 @@ export class Host extends ServiceOwner {
|
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
+
|
|
123
|
+
this.extra = data.extra;
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
_applyExtends(host) {
|
|
@@ -451,7 +453,7 @@ export class Host extends ServiceOwner {
|
|
|
451
453
|
}
|
|
452
454
|
|
|
453
455
|
async *preparePackages(dir) {
|
|
454
|
-
|
|
456
|
+
let packageData = {
|
|
455
457
|
dir,
|
|
456
458
|
sources: [
|
|
457
459
|
new FileContentProvider(
|
|
@@ -462,8 +464,7 @@ export class Host extends ServiceOwner {
|
|
|
462
464
|
{ base: this.directory, pattern: "*_key" },
|
|
463
465
|
{ destination: "/etc/ssh/", mode: 0o600 }
|
|
464
466
|
),
|
|
465
|
-
new FileContentProvider(dir + "/")
|
|
466
|
-
new FileContentProvider(join(this.directory, "extra") + "/")
|
|
467
|
+
new FileContentProvider(dir + "/")
|
|
467
468
|
],
|
|
468
469
|
outputs: this.outputs,
|
|
469
470
|
properties: {
|
|
@@ -493,8 +494,10 @@ export class Host extends ServiceOwner {
|
|
|
493
494
|
await generateKnownHosts(this.owner.hosts(), join(dir, "root", ".ssh"));
|
|
494
495
|
|
|
495
496
|
for (const service of this.services) {
|
|
496
|
-
if (service.systemdConfig) {
|
|
497
|
-
const { serviceName, configFileName, content } = service.systemdConfig(
|
|
497
|
+
if (service.systemdConfig) {
|
|
498
|
+
const { serviceName, configFileName, content } = service.systemdConfig(
|
|
499
|
+
this.name
|
|
500
|
+
);
|
|
498
501
|
await writeLines(dir, configFileName, sectionLines(...content));
|
|
499
502
|
|
|
500
503
|
addHook(
|
|
@@ -506,5 +509,21 @@ export class Host extends ServiceOwner {
|
|
|
506
509
|
}
|
|
507
510
|
|
|
508
511
|
yield packageData;
|
|
512
|
+
|
|
513
|
+
if (this.extra) {
|
|
514
|
+
packageData = {
|
|
515
|
+
dir,
|
|
516
|
+
sources: [new FileContentProvider(join(this.directory, "extra") + "/")],
|
|
517
|
+
outputs: this.outputs,
|
|
518
|
+
properties: {
|
|
519
|
+
name: `${this.typeName}-extra-${this.owner.name}-${this.name}`,
|
|
520
|
+
description: `additional files for ${this.fullName}`,
|
|
521
|
+
access: "private",
|
|
522
|
+
dependencies: [`${this.typeName}-${this.owner.name}-${this.name}`]
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
yield packageData;
|
|
527
|
+
}
|
|
509
528
|
}
|
|
510
529
|
}
|