#!/bin/bash # Get host info from terraform output and add SSH keys for both IP and hostname.incus terraform output -json uranian_hosts | jq -r 'to_entries[] | "\(.key) \(.value.ipv4)"' | while read hostname ip; do # Add key for IP address ssh-keyscan -H "$ip" >> ~/.ssh/known_hosts # Add key for hostname.incus ssh-keyscan -H "$hostname.incus" >> ~/.ssh/known_hosts done