Merge "add-build-sshkey: call cmd with command"

This commit is contained in:
Zuul 2020-08-11 19:34:37 +00:00 committed by Gerrit Code Review
commit 7633994ed6

View File

@ -16,9 +16,9 @@
echo "Add build ssh keys to authorized_keys"
{% if win_admin_ssh | default(false) %}
ssh -o BatchMode=yes {{ ansible_user }}@{{ ansible_host }} cmd "type .ssh\\id_rsa.pub >> %programdata%\\ssh\\administrators_authorized_keys"
ssh -o BatchMode=yes {{ ansible_user }}@{{ ansible_host }} cmd /c "type .ssh\\id_rsa.pub >> %programdata%\\ssh\\administrators_authorized_keys"
{% else %}
ssh -o BatchMode=yes {{ ansible_user }}@{{ ansible_host }} cmd "type .ssh\\id_rsa.pub >> .ssh\\authorized_keys"
ssh -o BatchMode=yes {{ ansible_user }}@{{ ansible_host }} cmd /c "type .ssh\\id_rsa.pub >> .ssh\\authorized_keys"
{% endif %}
register: windows_remote_ssh
# Ignore errors here because this should not break non-ssh enabled windows hosts