Compare commits
7 Commits
stage
...
7434a65590
| Author | SHA1 | Date | |
|---|---|---|---|
| 7434a65590 | |||
| 15e6471e7e | |||
| e9bac70cae | |||
| 97295a7071 | |||
| 6ca189b32c | |||
| 2aa9950f59 | |||
| c1f86483ad |
@@ -110,9 +110,7 @@ class Controller:
|
||||
"-o",
|
||||
"IdentitiesOnly=yes",
|
||||
"-o",
|
||||
"StrictHostKeyChecking=no",
|
||||
"-o",
|
||||
"UserKnownHostsFile=/dev/null",
|
||||
"StrictHostKeyChecking=accept-new",
|
||||
"-i",
|
||||
self.ssh_key,
|
||||
]
|
||||
@@ -174,7 +172,14 @@ class Controller:
|
||||
return last
|
||||
|
||||
def prepare_known_hosts(self):
|
||||
pass
|
||||
ssh_dir = Path.home() / ".ssh"
|
||||
ssh_dir.mkdir(parents=True, exist_ok=True)
|
||||
(ssh_dir / "known_hosts").touch()
|
||||
run_local(["chmod", "700", str(ssh_dir)])
|
||||
run_local(["chmod", "600", str(ssh_dir / "known_hosts")])
|
||||
for ip in self.node_ips.values():
|
||||
run_local(["ssh-keygen", "-R", ip], check=False)
|
||||
run_local(f"ssh-keyscan -H {shlex.quote(ip)} >> {shlex.quote(str(ssh_dir / 'known_hosts'))}", check=False)
|
||||
|
||||
def prepare_remote_nix(self, ip):
|
||||
self.remote(ip, "sudo mkdir -p /etc/nix")
|
||||
|
||||
@@ -10,7 +10,7 @@ in
|
||||
./hardware-configuration.nix;
|
||||
|
||||
networking.hostName = "k8s-base-template";
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
networking.useDHCP = false;
|
||||
networking.useNetworkd = true;
|
||||
networking.nameservers = [ "1.1.1.1" "8.8.8.8" ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user