pmcf 2.71.7 → 2.71.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cluster.mjs +32 -33
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.71.7",
3
+ "version": "2.71.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/cluster.mjs CHANGED
@@ -127,7 +127,7 @@ export class Cluster extends Host {
127
127
  cfg.push(` virtual_router_id ${cluster.routerId}`);
128
128
 
129
129
  let reducedPrio = cluster.masters.indexOf(ni);
130
- if(reducedPrio < 0) {
130
+ if (reducedPrio < 0) {
131
131
  reducedPrio = cluster.backups.indexOf(ni) + 5;
132
132
  }
133
133
 
@@ -193,6 +193,37 @@ export class Cluster extends Host {
193
193
  cfg.push("}", "");
194
194
  break; // only one for now
195
195
  }
196
+ await writeLines(
197
+ join(packageStagingDir, "/usr/lib/systemd/system"),
198
+ `${cluster.name}-master.target`,
199
+ [
200
+ "[Unit]",
201
+ `Description=master state of cluster ${cluster.name}`,
202
+ "PartOf=keepalived.service",
203
+ `Conflicts=${cluster.name}-fault.target`
204
+ ]
205
+ );
206
+
207
+ await writeLines(
208
+ join(packageStagingDir, "/usr/lib/systemd/system"),
209
+ `${cluster.name}-backup.target`,
210
+ [
211
+ "[Unit]",
212
+ `Description=backup state of cluster ${cluster.name}`,
213
+ "PartOf=keepalived.service",
214
+ `Conflicts=${cluster.name}-fault.target`
215
+ ]
216
+ );
217
+
218
+ await writeLines(
219
+ join(packageStagingDir, "/usr/lib/systemd/system"),
220
+ `${cluster.name}-fault.target`,
221
+ [
222
+ "[Unit]",
223
+ `Description=fault state of cluster ${cluster.name}`,
224
+ `Conflicts=${cluster.name}-master.target ${cluster.name}-backup.target`
225
+ ]
226
+ );
196
227
  }
197
228
 
198
229
  await writeLines(
@@ -201,38 +232,6 @@ export class Cluster extends Host {
201
232
  cfg
202
233
  );
203
234
 
204
- await writeLines(
205
- join(packageStagingDir, "/usr/lib/systemd/system"),
206
- `${this.name}-master.target`,
207
- [
208
- "[Unit]",
209
- `Description=master state of cluster ${this.name}`,
210
- "PartOf=keepalived.service",
211
- `Conflicts=${this.name}-fault.target`
212
- ]
213
- );
214
-
215
- await writeLines(
216
- join(packageStagingDir, "/usr/lib/systemd/system"),
217
- `${this.name}-backup.target`,
218
- [
219
- "[Unit]",
220
- `Description=backup state of cluster ${this.name}`,
221
- "PartOf=keepalived.service",
222
- `Conflicts=${this.name}-fault.target`
223
- ]
224
- );
225
-
226
- await writeLines(
227
- join(packageStagingDir, "/usr/lib/systemd/system"),
228
- `${this.name}-fault.target`,
229
- [
230
- "[Unit]",
231
- `Description=fault state of cluster ${this.name}`,
232
- `Conflicts=${this.name}-master.target ${this.name}-backup.target`
233
- ]
234
- );
235
-
236
235
  yield result;
237
236
  }
238
237
  }