feat(cluster): add network share for files
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
17ecb8975c
commit
ee69aab869
3 changed files with 34 additions and 13 deletions
|
@ -10,6 +10,8 @@
|
||||||
caddy = caddy-plugins.packages.${pkgs.system}.default;
|
caddy = caddy-plugins.packages.${pkgs.system}.default;
|
||||||
in {
|
in {
|
||||||
imports = [caddy-plugins.nixosModules.default];
|
imports = [caddy-plugins.nixosModules.default];
|
||||||
|
|
||||||
|
# User stuff
|
||||||
environment.systemPackages = [caddy];
|
environment.systemPackages = [caddy];
|
||||||
users.users.${mainUser}.extraGroups = ["caddy"];
|
users.users.${mainUser}.extraGroups = ["caddy"];
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{...}: {
|
{pkgs, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./options.nix
|
./options.nix
|
||||||
../corosync.nix
|
../corosync.nix
|
||||||
|
@ -7,20 +7,38 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
# TODO: update script
|
# TODO: update script
|
||||||
services.pacemaker = {
|
services = {
|
||||||
enable = true;
|
pacemaker = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
resources = {
|
resources = {
|
||||||
"caddy" = {
|
"caddy" = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualIps = [
|
virtualIps = [
|
||||||
{
|
{
|
||||||
id = "main";
|
id = "main";
|
||||||
interface = "eno1";
|
interface = "eno1";
|
||||||
ip = "10.0.0.130";
|
ip = "10.0.0.130";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rpcbind.enable = true; # needed for NFS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [nfs-utils];
|
||||||
|
|
||||||
|
systemd.mounts = [
|
||||||
|
{
|
||||||
|
type = "nfs";
|
||||||
|
mountConfig = {
|
||||||
|
Options = "noatime";
|
||||||
|
};
|
||||||
|
what = "servivi:/caddy";
|
||||||
|
where = "/var/lib/caddy";
|
||||||
|
requiredBy = ["caddy.service"];
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,6 +204,7 @@ in {
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
# The config needs to be installed from one node only
|
# The config needs to be installed from one node only
|
||||||
|
# TODO: add assertion, corosync must be enabled with at least one node
|
||||||
if [ "$(uname -n)" = ${host1} ]; then
|
if [ "$(uname -n)" = ${host1} ]; then
|
||||||
# TODO: setup stonith / fencing
|
# TODO: setup stonith / fencing
|
||||||
crm_attribute --type crm_config --name stonith-enabled --update false
|
crm_attribute --type crm_config --name stonith-enabled --update false
|
||||||
|
|
Loading…
Reference in a new issue