{% for host in hostvars[inventory_hostname]['hosts_to_backup'] %} Host {{ host.hostname }}_backup Hostname {{ host.ip | default(host.fqdn) }} User root IdentityFile ~/.ssh/backup_ed25519 IdentitiesOnly yes {% endfor %}