{% for host in hostvars.values() | map(attribute='ansible_hostname') | sort %} Host {{ host }} Port {{ ssh_port }} IdentityFile /root/.ssh/key StrictHostKeyChecking no {% endfor %}