deployerbot: use vpn for actual deploying anyway
This commit is contained in:
parent
dba036a102
commit
21e96199bb
@ -89,7 +89,7 @@ in {
|
||||
enable = true;
|
||||
uidgid = myData.uidgid.updaterbot-deployee;
|
||||
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 = [
|
||||
{
|
||||
derivationTarget = ".#fwminex";
|
||||
altHostname = myData.hosts."fwminex.motiejus.jakst".vno1IP;
|
||||
pingTarget = myData.hosts."fwminex.motiejus.jakst".vno1IP;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
@ -2,20 +2,18 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
myData,
|
||||
...
|
||||
}: let
|
||||
cfg = config.mj.services.deployerbot;
|
||||
mkOptional = {
|
||||
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 \
|
||||
--ssh-opts="-i ''${CREDENTIALS_DIRECTORY}/ssh-key" \
|
||||
--ssh-user=deployerbot-follower \
|
||||
--confirm-timeout 60 \
|
||||
--hostname ${altHostname} \
|
||||
--targets ${derivationTarget} -- \
|
||||
--accept-flake-config
|
||||
fi
|
||||
@ -29,7 +27,7 @@ in {
|
||||
{...}: {
|
||||
options = {
|
||||
derivationTarget = lib.mkOption {type = str;};
|
||||
altHostname = lib.mkOption {type = str;};
|
||||
pingTarget = lib.mkOption {type = str;};
|
||||
};
|
||||
}
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user