diff options
Diffstat (limited to 'final/local_script')
| -rwxr-xr-x | final/local_script | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/final/local_script b/final/local_script new file mode 100755 index 0000000..14b6121 --- /dev/null +++ b/final/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 |
