diff options
| author | jerome <jerome@xlinfo.fr> | 2025-08-19 19:57:02 +0200 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2025-08-19 19:57:02 +0200 |
| commit | 59b67e27b770c9e51575ca83174da4b72aefcc51 (patch) | |
| tree | 5c86ec379730699f93ce09a0e7ae41faff2fccb9 | |
| parent | f3ebe3bf33d6812623226c256486885480303bf5 (diff) | |
| download | incus-59b67e27b770c9e51575ca83174da4b72aefcc51.tar.gz incus-59b67e27b770c9e51575ca83174da4b72aefcc51.zip | |
local_script
| -rw-r--r-- | final/hosts | 4 | ||||
| -rwxr-xr-x | final/local_script | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/final/hosts b/final/hosts index 4489216..a87d214 100644 --- a/final/hosts +++ b/final/hosts @@ -1,4 +1,2 @@ -webserver1 ansible_host=192.168.122.150 ansible_user=ansible ansible_become=true webserver2 ansible_host=192.168.122.28 ansible_user=ansible ansible_become=true -webserver1 ansible_host=192.168.122.72 ansible_user=ansible ansible_become=true -webserver2 ansible_host=192.168.122.11 ansible_user=ansible ansible_become=true +webserver1 ansible_host=192.168.2.1 ansible_user=ansible ansible_become=true diff --git a/final/local_script b/final/local_script index 14b6121..8040bb9 100755 --- a/final/local_script +++ b/final/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 |
