From 34cfe44ca5c63c354339aa502052d9054a36bf60 Mon Sep 17 00:00:00 2001 From: Tudor Tabacel Date: Fri, 9 Nov 2018 14:20:17 +0100 Subject: [PATCH] mirror-workspace-git: use port when pushing git repo through ssh In the case of using a custom SSH port to connect to the ansible host, the task of pushing the repository failed, as it assumed the SSH port to be the default 22. Now the command is aware of the custom SSH port, as it is specified in the host facts. Change-Id: I3418016ad5a57e3024a8a553340a7e69b7d1c2fe --- roles/mirror-workspace-git-repos/tasks/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mirror-workspace-git-repos/tasks/main.yaml b/roles/mirror-workspace-git-repos/tasks/main.yaml index 2c9f19184..1916124f1 100644 --- a/roles/mirror-workspace-git-repos/tasks/main.yaml +++ b/roles/mirror-workspace-git-repos/tasks/main.yaml @@ -7,7 +7,7 @@ with_dict: "{{ zuul.projects }}" - name: Synchronize src repos to workspace directory - command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}/{{ ansible_user_dir }}/{{ item.value.src_dir}}" + command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}:{{ ansible_port }}/{{ ansible_user_dir }}/{{ item.value.src_dir}}" args: chdir: "{{ zuul.executor.work_root }}/{{ item.value.src_dir }}" with_dict: "{{ zuul.projects }}"