summaryrefslogtreecommitdiff
path: root/tofu/ansible/local_script
blob: 14b6121ac3a51ec76d09c699ee3d1c309a7bb8b6 (plain)
1
2
3
4
5
6
7
8
#!/bin/bash
ssh-keygen -f ~/.ssh/known_hosts -R $1
# on attend que cloud-init ait fini d'installer le serveur SSH
while ! ssh-keyscan -H $1 >> ~/.ssh/known_hosts; do
		sleep 1
done
ansible -u ansible --become -i "$1," -m ping all
echo $2 ansible_host=$1 ansible_user=ansible ansible_become=true >> hosts