pmcf 2.17.0 → 2.18.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/services/dns.mjs +13 -13
package/package.json
CHANGED
package/src/services/dns.mjs
CHANGED
|
@@ -170,10 +170,10 @@ export class DNSService extends ExtraSourceService {
|
|
|
170
170
|
async *preparePackages(dir) {
|
|
171
171
|
const location = this.owner.owner;
|
|
172
172
|
const name = location.name;
|
|
173
|
-
const p1 = join(dir, "p1");
|
|
173
|
+
const p1 = join(dir, "p1") + "/";
|
|
174
174
|
const packageData = {
|
|
175
175
|
dir: p1,
|
|
176
|
-
sources: [new FileContentProvider(p1
|
|
176
|
+
sources: [new FileContentProvider(p1)],
|
|
177
177
|
outputs: this.outputs,
|
|
178
178
|
properties: {
|
|
179
179
|
name: `named-${name}`,
|
|
@@ -207,10 +207,10 @@ export class DNSService extends ExtraSourceService {
|
|
|
207
207
|
yield packageData;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
const p2 = join(dir, "p2");
|
|
210
|
+
const p2 = join(dir, "p2") + "/";
|
|
211
211
|
|
|
212
|
+
packageData.dir = p2;
|
|
212
213
|
packageData.properties = {
|
|
213
|
-
dir: p2,
|
|
214
214
|
name: `named-zones-${name}`,
|
|
215
215
|
description: `zone definitions for ${location.fullName}`,
|
|
216
216
|
dependencies: ["mf-named"],
|
|
@@ -221,7 +221,7 @@ export class DNSService extends ExtraSourceService {
|
|
|
221
221
|
|
|
222
222
|
packageData.sources = [
|
|
223
223
|
new FileContentProvider(
|
|
224
|
-
p2
|
|
224
|
+
p2,
|
|
225
225
|
{
|
|
226
226
|
mode: 0o644,
|
|
227
227
|
owner: "named",
|
|
@@ -272,12 +272,6 @@ async function generateZoneDefs(dns, location, packageData) {
|
|
|
272
272
|
records: new Set([SOARecord, NSRecord])
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
-
addHook(
|
|
276
|
-
packageData.properties.hooks,
|
|
277
|
-
"post_upgrade",
|
|
278
|
-
`rm -f /var/lib/named/${zone.file}.jnl`
|
|
279
|
-
);
|
|
280
|
-
|
|
281
275
|
const config = {
|
|
282
276
|
name: `${domain}.zone.conf`,
|
|
283
277
|
zones: [zone]
|
|
@@ -296,11 +290,17 @@ async function generateZoneDefs(dns, location, packageData) {
|
|
|
296
290
|
}
|
|
297
291
|
}
|
|
298
292
|
|
|
299
|
-
|
|
293
|
+
const foreignZones = configs.map(c => c.zones).flat();
|
|
294
|
+
|
|
295
|
+
if (foreignZones.length) {
|
|
300
296
|
addHook(
|
|
301
297
|
packageData.properties.hooks,
|
|
302
298
|
"post_upgrade",
|
|
303
|
-
|
|
299
|
+
`rm -f ${foreignZones.map(zone => `/var/lib/named/${zone.file}.jnl`)}\n` +
|
|
300
|
+
"systemctl try-reload-or-restart named\n" +
|
|
301
|
+
`/usr/bin/named-hostname-info ${foreignZones
|
|
302
|
+
.map(zone => zone.id)
|
|
303
|
+
.join(" ")}|/usr/bin/named-hostname-update`
|
|
304
304
|
);
|
|
305
305
|
}
|
|
306
306
|
|