
The winrm protocol is very inefficient when copying things to the node therefore it makes sense to have working ssh connections on windows hosts. Adding windows support to the add-build-sshkey role is the first step towards this. Change-Id: I5591b39b0107385fec8c6df1fbe6c316177d32e6
21 lines
805 B
YAML
21 lines
805 B
YAML
- name: Configure ssh on remote node
|
|
delegate_to: localhost
|
|
shell: |+
|
|
set -eu
|
|
|
|
echo "Add node to known_hosts"
|
|
ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no {{ ansible_user }}@{{ ansible_host }} echo success
|
|
|
|
echo
|
|
|
|
# We use scp here as this is much more performant than ansible copy
|
|
echo "Copy build ssh keys to node"
|
|
scp {{ zuul_temp_ssh_key }} {{ ansible_user }}@{{ ansible_host }}:.ssh/id_rsa
|
|
scp {{ zuul_temp_ssh_key }}.pub {{ ansible_user }}@{{ ansible_host }}:.ssh/id_rsa.pub
|
|
|
|
echo "Add build ssh keys to authorized_keys"
|
|
ssh {{ ansible_user }}@{{ ansible_host }} "type .ssh\\id_rsa.pub >> .ssh\\authorized_keys"
|
|
register: windows_remote_ssh
|
|
# Ignore errors here because this should not break non-ssh enabled windows hosts
|
|
ignore_errors: true
|