diff options
author | Christian Pointner <equinox@spreadspace.org> | 2017-12-13 00:16:24 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2017-12-13 00:16:24 +0100 |
commit | 66de6e08c414ada9111d8241a6ef5d844c3527bf (patch) | |
tree | e0eff089137c8071dd01c7cbeee96f54ebb728bb | |
parent | limit tftp server to vm bridge (diff) |
added workaround for new key detection
-rwxr-xr-x | remove-known-host.sh | 18 | ||||
-rw-r--r-- | roles/vm-install/tasks/main.yaml | 8 |
2 files changed, 10 insertions, 16 deletions
diff --git a/remove-known-host.sh b/remove-known-host.sh index d681f0e6..d2c8b8d5 100755 --- a/remove-known-host.sh +++ b/remove-known-host.sh @@ -5,24 +5,10 @@ if [ -z "$1" ]; then exit 1 fi -TMP=`host -t A "$1" | grep -v "has no"` -IP=`echo "$TMP" | awk '{ print($4) }'` -HOST=`echo "$TMP" | awk '{ print($1) }'` - -TMP=`host -t AAAA "$1" | grep -v "has no"` -IP6=`echo "$TMP" | awk '{ print($5) }'` -HOST6=`echo "$TMP" | awk '{ print($1) }'` - -if [ "$HOST6" = "$HOST" ]; then - HOST6="" -fi SHORT="$1" -if [ "$SHORT" = "$HOST" ] || [ "$SHORT" == "$HOST6" ]; then - SHORT="" -fi - +SSH_HOST=$(ssh -G "$1" | grep "^hostname " | awk '{ print($2) }' ) -for name in $IP $IP6 $HOST $HOST6 $SHORT; do +for name in $SHORT $SSH_HOST; do ssh-keygen -f "$HOME/.ssh/known_hosts" -R "$name" done diff --git a/roles/vm-install/tasks/main.yaml b/roles/vm-install/tasks/main.yaml index 4e5167d2..a59e6fe2 100644 --- a/roles/vm-install/tasks/main.yaml +++ b/roles/vm-install/tasks/main.yaml @@ -109,11 +109,19 @@ delegate_to: "{{ vm_install.host }}" when: vm_install.autostart is defined +- name: disable ssh StrictHostKeyChecking for the next step + set_fact: + ansible_ssh_extra_args: -o StrictHostKeyChecking=no + - name: wait for vm to start up wait_for_connection: delay: 5 timeout: 120 +- name: reenable StrictHostKeyChecking + set_fact: + ansible_ssh_extra_args: "" + - name: remove dummy logical volume lvol: vg: "{{ inventory_hostname }}" |