diff --git a/roles/upload-git-mirror/tasks/main.yaml b/roles/upload-git-mirror/tasks/main.yaml index 1de834b4d..c52e1887d 100644 --- a/roles/upload-git-mirror/tasks/main.yaml +++ b/roles/upload-git-mirror/tasks/main.yaml @@ -10,6 +10,12 @@ dest: "{{ ssh_private_key_tmp.path }}" mode: 0600 + # If the markers in an id_rsa don't end with a newline some + # versions of ssh won't read the key. + - name: Ensure ssh_key ends with newline + shell: | + echo >> {{ ssh_private_key_tmp.path }} + - name: Generate SSH configuration set_fact: ssh_config: | diff --git a/test-playbooks/upload-git-mirror.yaml b/test-playbooks/upload-git-mirror.yaml index d09977c11..3ec58437b 100644 --- a/test-playbooks/upload-git-mirror.yaml +++ b/test-playbooks/upload-git-mirror.yaml @@ -62,9 +62,6 @@ host: localhost ssh_key: "{{ private_key_contents.stdout }}" host_key: "{{ host_key.stdout }}" - # TODO: key is renamed to ssh_key to prevent ambiguity with host_key. - # Remove key when the rename has landed in the role. - key: "{{ private_key_contents.stdout }}" git_mirror_repository: "{{ test_repo_path }}" include_role: name: upload-git-mirror