specify the ssh key

This commit is contained in:
Andreas Zweili 2022-01-17 17:52:49 +01:00
parent 37ce01ac12
commit 67bf564c89
1 changed files with 4 additions and 1 deletions

View File

@ -6,10 +6,13 @@ hosts = [
"nixos-test-vm",
]
update_command = 'tmux new -s updates "cd ~/.nixos && git pull && sudo nixos-rebuild -j auto switch || bash;"'
rsa_key = "~/.nixos/secrets/ssh_keys/ansible/ansible.key"
for host in hosts:
fqdn = "{}.2li.local".format(host)
print(fqdn)
print("-" * len(fqdn))
ssh -t @(fqdn) 'tmux new -s updates "cd ~/.nixos && git pull && sudo nixos-rebuild -j auto switch || bash;"'
ssh -i @(rsa_key) -t @(fqdn) @(update_command)
print("")
print("")