pmcf 1.91.2 → 1.93.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/address.mjs +32 -0
- package/src/cluster.mjs +3 -3
- package/src/dns.mjs +10 -1
- package/src/host.mjs +9 -1
- package/src/module.mjs +1 -0
- package/types/address.d.mts +17 -0
- package/types/host.d.mts +8 -0
- package/types/module.d.mts +1 -0
package/package.json
CHANGED
package/src/address.mjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Base } from "./base.mjs";
|
|
2
|
+
import { addType } from "./types.mjs";
|
|
3
|
+
|
|
4
|
+
const AddressTypeDefinition = {
|
|
5
|
+
name: "address",
|
|
6
|
+
owners: ["location", "owner", "network", "root"],
|
|
7
|
+
priority: 0.6,
|
|
8
|
+
constructWithIdentifierOnly: true,
|
|
9
|
+
properties: {
|
|
10
|
+
address: {
|
|
11
|
+
type: "string",
|
|
12
|
+
collection: false,
|
|
13
|
+
writeable: false,
|
|
14
|
+
identifier: true
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export class Address extends Base {
|
|
21
|
+
static {
|
|
22
|
+
addType(this);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static get typeDefinition() {
|
|
26
|
+
return AddressTypeDefinition;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
constructor(owner, address) {
|
|
30
|
+
super(owner, address);
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/cluster.mjs
CHANGED
|
@@ -186,7 +186,7 @@ export class Cluster extends Host {
|
|
|
186
186
|
`${this.name}-master.target`,
|
|
187
187
|
[
|
|
188
188
|
"[Unit]",
|
|
189
|
-
`Description=
|
|
189
|
+
`Description=master state of cluster ${this.name}`,
|
|
190
190
|
"PartOf=keepalived.service",
|
|
191
191
|
`Conflicts=${this.name}-fault.target`
|
|
192
192
|
]
|
|
@@ -197,7 +197,7 @@ export class Cluster extends Host {
|
|
|
197
197
|
`${this.name}-backup.target`,
|
|
198
198
|
[
|
|
199
199
|
"[Unit]",
|
|
200
|
-
`Description=
|
|
200
|
+
`Description=backup state of cluster ${this.name}`,
|
|
201
201
|
"PartOf=keepalived.service",
|
|
202
202
|
`Conflicts=${this.name}-fault.target`
|
|
203
203
|
]
|
|
@@ -208,7 +208,7 @@ export class Cluster extends Host {
|
|
|
208
208
|
`${this.name}-fault.target`,
|
|
209
209
|
[
|
|
210
210
|
"[Unit]",
|
|
211
|
-
`Description=
|
|
211
|
+
`Description=fault state of cluster ${this.name}`,
|
|
212
212
|
`Conflicts=${this.name}-master.target ${this.name}-backup.target`
|
|
213
213
|
]
|
|
214
214
|
);
|
package/src/dns.mjs
CHANGED
|
@@ -288,10 +288,12 @@ async function generateZoneDefs(dns, packageData) {
|
|
|
288
288
|
};
|
|
289
289
|
configs.push(config);
|
|
290
290
|
|
|
291
|
+
const locationRecord = DNSRecord("location", "TXT", dns.location.name)
|
|
292
|
+
|
|
291
293
|
const zone = {
|
|
292
294
|
id: domain,
|
|
293
295
|
file: `${ownerName}/${domain}.zone`,
|
|
294
|
-
records: new Set([SOARecord, NSRecord])
|
|
296
|
+
records: new Set([SOARecord, NSRecord, locationRecord])
|
|
295
297
|
};
|
|
296
298
|
config.zones.push(zone);
|
|
297
299
|
|
|
@@ -368,6 +370,13 @@ async function generateZoneDefs(dns, packageData) {
|
|
|
368
370
|
|
|
369
371
|
if (!hosts.has(host)) {
|
|
370
372
|
hosts.add(host);
|
|
373
|
+
|
|
374
|
+
for (const foreignDomainName of host.foreignDomainNames) {
|
|
375
|
+
zone.records.add(
|
|
376
|
+
DNSRecord("external", "PTR", dnsFullName(foreignDomainName))
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
|
|
371
380
|
for (const service of host.findServices()) {
|
|
372
381
|
for (const record of service.dnsRecordsForDomainName(
|
|
373
382
|
domainName,
|
package/src/host.mjs
CHANGED
|
@@ -361,9 +361,10 @@ export class Host extends Base {
|
|
|
361
361
|
|
|
362
362
|
*networkAddresses() {
|
|
363
363
|
for (const networkInterface of this.networkInterfaces.values()) {
|
|
364
|
-
for (const [address, subnet] of networkInterface.ipAddresses) {
|
|
364
|
+
for (const [address, subnet, domainName] of networkInterface.ipAddresses) {
|
|
365
365
|
yield {
|
|
366
366
|
networkInterface,
|
|
367
|
+
domainName,
|
|
367
368
|
address,
|
|
368
369
|
subnet
|
|
369
370
|
};
|
|
@@ -437,6 +438,7 @@ const NetworkInterfaceTypeDefinition = {
|
|
|
437
438
|
properties: {
|
|
438
439
|
...networkProperties,
|
|
439
440
|
...networkAddressProperties,
|
|
441
|
+
hostName: { type: "string", collection: false, writeable: true },
|
|
440
442
|
ipAddresses: { type: "string", collection: true, writeable: true },
|
|
441
443
|
|
|
442
444
|
hwaddr: { type: "string", collection: false, writeable: true },
|
|
@@ -464,6 +466,7 @@ export class NetworkInterface extends Base {
|
|
|
464
466
|
#kind;
|
|
465
467
|
arpbridge;
|
|
466
468
|
hwaddr;
|
|
469
|
+
hostName;
|
|
467
470
|
|
|
468
471
|
constructor(owner, data) {
|
|
469
472
|
super(owner, data);
|
|
@@ -542,6 +545,11 @@ export class NetworkInterface extends Base {
|
|
|
542
545
|
}
|
|
543
546
|
}
|
|
544
547
|
|
|
548
|
+
get domainName()
|
|
549
|
+
{
|
|
550
|
+
return this.hostName ? [this.hostName,this.host.domain].join('.') : this.host.dmainName;
|
|
551
|
+
}
|
|
552
|
+
|
|
545
553
|
get host() {
|
|
546
554
|
return this.owner;
|
|
547
555
|
}
|
package/src/module.mjs
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class Address extends Base {
|
|
2
|
+
static get typeDefinition(): {
|
|
3
|
+
name: string;
|
|
4
|
+
owners: string[];
|
|
5
|
+
priority: number;
|
|
6
|
+
constructWithIdentifierOnly: boolean;
|
|
7
|
+
properties: {
|
|
8
|
+
address: {
|
|
9
|
+
type: string;
|
|
10
|
+
collection: boolean;
|
|
11
|
+
writeable: boolean;
|
|
12
|
+
identifier: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
import { Base } from "./base.mjs";
|
package/types/host.d.mts
CHANGED
|
@@ -209,6 +209,7 @@ export class Host extends Base {
|
|
|
209
209
|
get networkInterfaces(): Map<any, any>;
|
|
210
210
|
networkAddresses(): Generator<{
|
|
211
211
|
networkInterface: any;
|
|
212
|
+
domainName: any;
|
|
212
213
|
address: any;
|
|
213
214
|
subnet: any;
|
|
214
215
|
}, void, unknown>;
|
|
@@ -282,6 +283,11 @@ export class NetworkInterface extends Base {
|
|
|
282
283
|
};
|
|
283
284
|
};
|
|
284
285
|
properties: {
|
|
286
|
+
hostName: {
|
|
287
|
+
type: string;
|
|
288
|
+
collection: boolean;
|
|
289
|
+
writeable: boolean;
|
|
290
|
+
};
|
|
285
291
|
ipAddresses: {
|
|
286
292
|
type: string;
|
|
287
293
|
collection: boolean;
|
|
@@ -366,6 +372,7 @@ export class NetworkInterface extends Base {
|
|
|
366
372
|
};
|
|
367
373
|
arpbridge: any;
|
|
368
374
|
hwaddr: any;
|
|
375
|
+
hostName: any;
|
|
369
376
|
addSubnet(address: any): any;
|
|
370
377
|
set ipAddresses(value: Map<any, any>);
|
|
371
378
|
get ipAddresses(): Map<any, any>;
|
|
@@ -378,6 +385,7 @@ export class NetworkInterface extends Base {
|
|
|
378
385
|
subnetForAddress(address: any): any;
|
|
379
386
|
get gateway(): any;
|
|
380
387
|
get gatewayAddress(): any;
|
|
388
|
+
get domainName(): any;
|
|
381
389
|
get network_interface(): this;
|
|
382
390
|
set network(network: any);
|
|
383
391
|
get network(): any;
|
package/types/module.d.mts
CHANGED