summaryrefslogtreecommitdiff
path: root/tofu/ansible/local_script
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2025-08-18 11:22:14 +0200
committerjerome <jerome@xlinfo.fr>2025-08-18 11:22:14 +0200
commit4293df73e636a3bb9097d4cbe80ae8c194862f6b (patch)
treec7cbf89deac7fcbc85850938b7c926778999c9bc /tofu/ansible/local_script
downloadincus-4293df73e636a3bb9097d4cbe80ae8c194862f6b.tar.gz
incus-4293df73e636a3bb9097d4cbe80ae8c194862f6b.zip
commit initial
Diffstat (limited to 'tofu/ansible/local_script')
-rwxr-xr-xtofu/ansible/local_script8
1 files changed, 8 insertions, 0 deletions
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