deployerbot: use vpn for actual deploying anyway
This commit is contained in:
parent
dba036a102
commit
21e96199bb
@ -89,7 +89,7 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
uidgid = myData.uidgid.updaterbot-deployee;
|
uidgid = myData.uidgid.updaterbot-deployee;
|
||||||
publicKey = myData.hosts."vno1-oh2.servers.jakst".publicKey;
|
publicKey = myData.hosts."vno1-oh2.servers.jakst".publicKey;
|
||||||
sshAllowSubnets = with myData.subnets; [tailscale.sshPattern vno1.sshPattern];
|
sshAllowSubnets = with myData.subnets; [tailscale.sshPattern];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@
|
|||||||
deployIfPresent = [
|
deployIfPresent = [
|
||||||
{
|
{
|
||||||
derivationTarget = ".#fwminex";
|
derivationTarget = ".#fwminex";
|
||||||
altHostname = myData.hosts."fwminex.motiejus.jakst".vno1IP;
|
pingTarget = myData.hosts."fwminex.motiejus.jakst".vno1IP;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -2,20 +2,18 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
myData,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.mj.services.deployerbot;
|
cfg = config.mj.services.deployerbot;
|
||||||
mkOptional = {
|
mkOptional = {
|
||||||
derivationTarget,
|
derivationTarget,
|
||||||
altHostname,
|
pingTarget,
|
||||||
}: ''
|
}: ''
|
||||||
if ${pkgs.inetutils}/bin/ping -c 1 ${altHostname}; then
|
if ${pkgs.inetutils}/bin/ping -c 1 ${pingTarget}; then
|
||||||
${pkgs.deploy-rs}/bin/deploy \
|
${pkgs.deploy-rs}/bin/deploy \
|
||||||
--ssh-opts="-i ''${CREDENTIALS_DIRECTORY}/ssh-key" \
|
--ssh-opts="-i ''${CREDENTIALS_DIRECTORY}/ssh-key" \
|
||||||
--ssh-user=deployerbot-follower \
|
--ssh-user=deployerbot-follower \
|
||||||
--confirm-timeout 60 \
|
--confirm-timeout 60 \
|
||||||
--hostname ${altHostname} \
|
|
||||||
--targets ${derivationTarget} -- \
|
--targets ${derivationTarget} -- \
|
||||||
--accept-flake-config
|
--accept-flake-config
|
||||||
fi
|
fi
|
||||||
@ -29,7 +27,7 @@ in {
|
|||||||
{...}: {
|
{...}: {
|
||||||
options = {
|
options = {
|
||||||
derivationTarget = lib.mkOption {type = str;};
|
derivationTarget = lib.mkOption {type = str;};
|
||||||
altHostname = lib.mkOption {type = str;};
|
pingTarget = lib.mkOption {type = str;};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
Loading…
Reference in New Issue
Block a user