pmcf 6.66.7 → 6.66.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.
- package/package.json +1 -1
- package/src/services/keepalived.mjs +16 -9
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
enum_string_attribute_writable,
|
|
6
6
|
priority_attribute_writable
|
|
7
7
|
} from "pacc";
|
|
8
|
-
import { FAMILY_IPV4 } from "ip-utilties";
|
|
8
|
+
import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
9
9
|
import { addType } from "../type.mjs";
|
|
10
10
|
import { PROTOCOL_TCP } from "../constants.mjs";
|
|
11
11
|
import { core } from "../core.mjs";
|
|
@@ -125,14 +125,18 @@ export class keepalived extends CoreService {
|
|
|
125
125
|
|
|
126
126
|
cfg.push(` interface ${ni.name}`);
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
function vip(slot, family) {
|
|
129
|
+
cfg.push(` ${slot} {`);
|
|
130
|
+
for (const na of cluster.networkAddresses(
|
|
131
|
+
na => na.networkInterface.kind !== "loopback" && na.family === family
|
|
132
|
+
)) {
|
|
133
|
+
cfg.push(` ${na.cidrAddress} dev ${ni.name} label ${clusterName}`);
|
|
134
|
+
}
|
|
135
|
+
cfg.push(" }");
|
|
134
136
|
}
|
|
135
|
-
|
|
137
|
+
|
|
138
|
+
vip("virtual_ipaddress", FAMILY_IPV4);
|
|
139
|
+
vip("virtual_ipaddress_excluded", FAMILY_IPV6);
|
|
136
140
|
|
|
137
141
|
cfg.push(` virtual_router_id ${cluster.id}`);
|
|
138
142
|
|
|
@@ -220,7 +224,10 @@ export class keepalived extends CoreService {
|
|
|
220
224
|
"[Unit]",
|
|
221
225
|
`Description=${state} state of cluster ${clusterName}`,
|
|
222
226
|
"PartOf=keepalived.service",
|
|
223
|
-
`Conflicts=${states
|
|
227
|
+
`Conflicts=${states
|
|
228
|
+
.filter(s => s !== state)
|
|
229
|
+
.map(other => `${clusterName}-${other}.target`)
|
|
230
|
+
.join(" ")}`
|
|
224
231
|
]
|
|
225
232
|
);
|
|
226
233
|
}
|