pmcf 6.1.4 → 6.1.6

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 CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.1.4",
3
+ "version": "6.1.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "packageManager": "npm@11.16.0",
7
+ "packageManager": "npm@11.18.0",
8
8
  "exports": {
9
9
  ".": {
10
10
  "default": "./src/module.mjs"
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "aggregated-map": "^1.0.7",
54
54
  "content-entry-transform": "^1.6.9",
55
- "ip-utilties": "^3.3.0",
55
+ "ip-utilties": "^3.4.0",
56
56
  "npm-pkgbuild": "^20.7.12",
57
57
  "pacc": "^10.4.0",
58
58
  "package-directory": "^8.2.0"
package/src/cluster.mjs CHANGED
@@ -91,7 +91,8 @@ export class Cluster extends Host {
91
91
  for (const cluster of [...this.owner.clusters].sort((a, b) =>
92
92
  a.name.localeCompare(b.name)
93
93
  )) {
94
- cfg.push(`vrrp_instance ${cluster.name} {`);
94
+ const name = cluster.name;
95
+ cfg.push(`vrrp_instance ${name} {`);
95
96
  cfg.push(
96
97
  ` state ${cluster.masters.indexOf(ni) === 0 ? "MASTER" : "BACKUP"}`
97
98
  );
@@ -108,7 +109,7 @@ export class Cluster extends Host {
108
109
  } {`
109
110
  );
110
111
  cfg.push(
111
- ` ${na.cidrAddress} dev ${ni.name} label ${cluster.name}`
112
+ ` ${na.cidrAddress} dev ${ni.name} label ${name}`
112
113
  );
113
114
  cfg.push(" }");
114
115
  }
@@ -120,7 +121,7 @@ export class Cluster extends Host {
120
121
  reducedPrio = cluster.backups.indexOf(ni) + 5;
121
122
  }
122
123
 
123
- const credential = cluster.name.toUpperCase() + "_PASSWORD";
124
+ const credential = name.toUpperCase() + "_PASSWORD";
124
125
  credentials.push(credential);
125
126
  cfg.push(` priority ${host.priority - reducedPrio}`);
126
127
  cfg.push(" smtp_alert");
@@ -131,9 +132,9 @@ export class Cluster extends Host {
131
132
  cfg.push(" }");
132
133
 
133
134
  cfg.push(
134
- ` notify_master "/usr/bin/systemctl start ${cluster.name}-master.target"`,
135
- ` notify_backup "/usr/bin/systemctl start ${cluster.name}-backup.target"`,
136
- ` notify_fault "/usr/bin/systemctl start ${cluster.name}-fault.target"`
135
+ ` notify_master "/usr/bin/systemctl start ${name}-master.target"`,
136
+ ` notify_backup "/usr/bin/systemctl start ${name}-backup.target"`,
137
+ ` notify_fault "/usr/bin/systemctl start ${name}-fault.target"`
137
138
  );
138
139
 
139
140
  cfg.push("}", "");
@@ -188,33 +189,33 @@ export class Cluster extends Host {
188
189
  }
189
190
  await writeLines(
190
191
  join(packageStagingDir, "/usr/lib/systemd/system"),
191
- `${cluster.name}-master.target`,
192
+ `${name}-master.target`,
192
193
  [
193
194
  "[Unit]",
194
- `Description=master state of cluster ${cluster.name}`,
195
+ `Description=master state of cluster ${name}`,
195
196
  "PartOf=keepalived.service",
196
- `Conflicts=${cluster.name}-backup.target ${cluster.name}-fault.target`
197
+ `Conflicts=${name}-backup.target ${name}-fault.target`
197
198
  ]
198
199
  );
199
200
 
200
201
  await writeLines(
201
202
  join(packageStagingDir, "/usr/lib/systemd/system"),
202
- `${cluster.name}-backup.target`,
203
+ `${name}-backup.target`,
203
204
  [
204
205
  "[Unit]",
205
- `Description=backup state of cluster ${cluster.name}`,
206
+ `Description=backup state of cluster ${name}`,
206
207
  "PartOf=keepalived.service",
207
- `Conflicts=${cluster.name}-master.target ${cluster.name}-fault.target`
208
+ `Conflicts=${name}-master.target ${name}-fault.target`
208
209
  ]
209
210
  );
210
211
 
211
212
  await writeLines(
212
213
  join(packageStagingDir, "/usr/lib/systemd/system"),
213
- `${cluster.name}-fault.target`,
214
+ `${name}-fault.target`,
214
215
  [
215
216
  "[Unit]",
216
- `Description=fault state of cluster ${cluster.name}`,
217
- `Conflicts=${cluster.name}-master.target ${cluster.name}-backup.target`
217
+ `Description=fault state of cluster ${name}`,
218
+ `Conflicts=${name}-master.target ${name}-backup.target`
218
219
  ]
219
220
  );
220
221
 
@@ -12,7 +12,7 @@ const _localDomains = new Set(["localhost"]);
12
12
 
13
13
  export class loopback extends SkeletonNetworkInterface {
14
14
  static specializationOf = NetworkInterface;
15
- static commonNamePattern = /^lo\d*$/;
15
+ static commonNamePattern = /^(lo\d*)|loopback$/;
16
16
 
17
17
  static {
18
18
  addType(this);