pmcf 1.61.7 → 1.61.9
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/cluster.mjs +11 -8
- package/src/location.mjs +1 -0
package/package.json
CHANGED
package/src/cluster.mjs
CHANGED
|
@@ -59,10 +59,10 @@ export class Cluster extends Host {
|
|
|
59
59
|
access: "private"
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
let interfaces = new Set();
|
|
64
64
|
|
|
65
|
-
for(const cluster of this.owner.clusters()) {
|
|
65
|
+
for (const cluster of this.owner.clusters()) {
|
|
66
66
|
interfaces = interfaces.union(cluster.masters.union(cluster.backups));
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -70,15 +70,19 @@ export class Cluster extends Host {
|
|
|
70
70
|
const host = ni.host;
|
|
71
71
|
const name = `keepalived-${host.name}`;
|
|
72
72
|
const packageStagingDir = join(stagingDir, name);
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
const cfg = [];
|
|
75
75
|
|
|
76
|
-
for(const cluster of this.owner.clusters())
|
|
76
|
+
for (const cluster of [...this.owner.clusters()].sort((a, b) =>
|
|
77
|
+
a.name.localeCompare(b.name)
|
|
78
|
+
)) {
|
|
77
79
|
cfg.push(`vrrp_instance ${cluster.name} {`);
|
|
78
80
|
cfg.push(` state ${cluster.masters.has(ni) ? "MASTER" : "BACKUP"}`);
|
|
79
|
-
cfg.push(` interface ${ni.name}
|
|
81
|
+
cfg.push(` interface ${ni.name}`);
|
|
80
82
|
cfg.push(" virtual_ipaddress {");
|
|
81
|
-
cfg.push(
|
|
83
|
+
cfg.push(
|
|
84
|
+
` ${cluster.cidrAddress} dev ${ni.name} label ${cluster.name}`
|
|
85
|
+
);
|
|
82
86
|
cfg.push(" }");
|
|
83
87
|
cfg.push(` virtual_router_id ${cluster.routerId}`);
|
|
84
88
|
cfg.push(` priority ${host.priority}`);
|
|
@@ -97,8 +101,7 @@ export class Cluster extends Host {
|
|
|
97
101
|
cfg
|
|
98
102
|
);
|
|
99
103
|
|
|
100
|
-
result.outputs = host.outputs,
|
|
101
|
-
result.properties.name = name;
|
|
104
|
+
(result.outputs = host.outputs), (result.properties.name = name);
|
|
102
105
|
result.properties.dependencies = ["keepalived"];
|
|
103
106
|
|
|
104
107
|
result.sources.push(
|