forked from zentralwerk/network
nixos-module/pacemaker: link the schemas instead of generating an empty broken cib.xml
This commit is contained in:
parent
7a516ab326
commit
5ed1091b74
|
@ -144,29 +144,10 @@ in {
|
||||||
requires = [ "corosync.service" ];
|
requires = [ "corosync.service" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
script =
|
script = ''
|
||||||
let
|
cp -srf ${cfg.package}/var/lib/pacemaker/* /var/lib/pacemaker/
|
||||||
cibXml = builtins.toFile "cib.xml" ''
|
|
||||||
<cib crm_feature_set="3.0.9" validate-with="pacemaker-2.1" have-quorum="1" dc-uuid="4">
|
|
||||||
<configuration>
|
|
||||||
<crm_config/>
|
|
||||||
<nodes>
|
|
||||||
${lib.concatMapStrings ({ nodeid, name, ring_addrs }: ''
|
|
||||||
<node id="${toString nodeid}" name="${name}"/>
|
|
||||||
'') config.services.corosync.nodelist}
|
|
||||||
</nodes>
|
|
||||||
<resources>
|
|
||||||
</resources>
|
|
||||||
<constraints>
|
|
||||||
</constraints>
|
|
||||||
</configuration>
|
|
||||||
</cib>
|
|
||||||
'';
|
|
||||||
in ''
|
|
||||||
cp ${cibXml} /var/lib/pacemaker/cib/cib.xml
|
|
||||||
chown hacluster:pacemaker /var/lib/pacemaker/cib/cib.xml
|
|
||||||
|
|
||||||
exec ${cfg.package}/sbin/pacemakerd
|
exec ${cfg.package}/sbin/pacemakerd
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
|
|
Loading…
Reference in New Issue