add task to scan age keys

This commit is contained in:
Jörg Thalheim 2022-12-30 20:51:58 +01:00
parent b2eab48b4f
commit 9dccdea0fe

View file

@ -103,6 +103,16 @@ find . \
"""
)
@task
def scan_age_keys(c, host):
"""
Scans for the host key via ssh an converts it to age
"""
import subprocess
proc = subprocess.run(["ssh-keyscan", host], stdout=subprocess.PIPE, text=True, check=True)
print("###### Age keys ######")
subprocess.run(["nix", "run", "--inputs-from", ".#", "nixpkgs#ssh-to-age"], input=proc.stdout, check=True, text=True)
@task
def format_disks(c, hosts="", disks=""):