diff --git a/nix/nixos-module/server/cluster.nix b/nix/nixos-module/server/cluster.nix
index 6c6c117..ff63879 100644
--- a/nix/nixos-module/server/cluster.nix
+++ b/nix/nixos-module/server/cluster.nix
@@ -33,7 +33,7 @@ in
gluster volume create lxc ${lib.concatMapStringsSep " " (server:
"\"${server}:$DIR\""
- ) (hostsWithRole "server")}
+ ) (hostsWithRole "server")} force
gluster volume set shared network.ping-timeout 2
gluster volume start lxc
@@ -54,32 +54,34 @@ in
'') (hostsWithRole "container")}
- ${lib.optionalString (! config.virtualisation ? qemu) ''
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
- ''}
+ ) config.site.cluster.pacemaker.pingdHosts
+ }"/>
+
+
+
+
+
+
'';
constraints = builtins.toFile "cib-constraints.xml" ''
- ${lib.concatMapStrings (server: ''
-
- '') (hostsWithRole "server")}
+ ${lib.optionalString (! config.virtualisation ? qemu) (
+ lib.concatMapStrings (server: ''
+
+ '') (hostsWithRole "server")
+ )}
'';
in writeScriptBin "setup-pacemaker" ''
diff --git a/nix/nixos-module/server/lxc-containers.nix b/nix/nixos-module/server/lxc-containers.nix
index 88edf36..8fbab64 100644
--- a/nix/nixos-module/server/lxc-containers.nix
+++ b/nix/nixos-module/server/lxc-containers.nix
@@ -131,7 +131,8 @@ let
systemctl restart lxc@$c
)
else
- echo Ignoring not-running container $c
+ echo Clearing pacemaker state for container $c
+ crm_resource -r lxc-$c -C
fi
done
set -e