summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2025-08-19 19:58:24 +0200
committerjerome <jerome@xlinfo.fr>2025-08-19 19:58:24 +0200
commit311c77aacaa10c64bba1caba93c90000dfe1cd6a (patch)
treece26d1a0c2c9d9d998d6d3d65f7e0de55b20684f
parent59b67e27b770c9e51575ca83174da4b72aefcc51 (diff)
downloadincus-311c77aacaa10c64bba1caba93c90000dfe1cd6a.tar.gz
incus-311c77aacaa10c64bba1caba93c90000dfe1cd6a.zip
local_script
-rwxr-xr-xfinal/local_script10
-rwxr-xr-xtofu/ansible/local_script11
2 files changed, 11 insertions, 10 deletions
diff --git a/final/local_script b/final/local_script
index 8040bb9..323c709 100755
--- a/final/local_script
+++ b/final/local_script
@@ -1,9 +1,9 @@
#!/bin/bash
-#ssh-keygen -f ~/.ssh/known_hosts -R $1
+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
+while ! ssh-keyscan -H $1 >> ~/.ssh/known_hosts; do
+ sleep 1
+done
+ansible -u ansible --become -i "$1," -m ping all
sed -i "/$2/d" hosts
echo $2 ansible_host=$1 ansible_user=ansible ansible_become=true >> hosts
diff --git a/tofu/ansible/local_script b/tofu/ansible/local_script
index 14b6121..8040bb9 100755
--- a/tofu/ansible/local_script
+++ b/tofu/ansible/local_script
@@ -1,8 +1,9 @@
#!/bin/bash
-ssh-keygen -f ~/.ssh/known_hosts -R $1
+#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
+#while ! ssh-keyscan -H $1 >> ~/.ssh/known_hosts; do
+# sleep 1
+#done
+#ansible -u ansible --become -i "$1," -m ping all
+sed -i "/$2/d" hosts
echo $2 ansible_host=$1 ansible_user=ansible ansible_become=true >> hosts