From 4293df73e636a3bb9097d4cbe80ae8c194862f6b Mon Sep 17 00:00:00 2001 From: jerome Date: Mon, 18 Aug 2025 11:22:14 +0200 Subject: commit initial --- tofu/ansible/local_script | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 tofu/ansible/local_script (limited to 'tofu/ansible/local_script') diff --git a/tofu/ansible/local_script b/tofu/ansible/local_script new file mode 100755 index 0000000..14b6121 --- /dev/null +++ b/tofu/ansible/local_script @@ -0,0 +1,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 -- cgit v1.2.3