From de6ed29bf700c14d9bf370bdb5b34057bc0251fa Mon Sep 17 00:00:00 2001 From: Sven Geboers Date: Sat, 28 Mar 2026 20:46:57 +0100 Subject: [PATCH] fix(ansible): use port 222 for Gitea SSH, write SSH config on server --- ansible/deploy.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ansible/deploy.yaml b/ansible/deploy.yaml index 26c7eda..cfd1134 100644 --- a/ansible/deploy.yaml +++ b/ansible/deploy.yaml @@ -4,15 +4,27 @@ remote_user: webapps tasks: + - name: ensure git.sgeboers.nl SSH config uses port 222 + ansible.builtin.blockinfile: + path: /home/webapps/.ssh/config + create: yes + mode: '0600' + marker: "# {mark} ANSIBLE MANAGED: git.sgeboers.nl" + block: | + Host git.sgeboers.nl + User git + Port 222 + IdentityFile /home/webapps/.ssh/ed25519 + - name: ensure git.sgeboers.nl is in known_hosts ansible.builtin.known_hosts: - name: git.sgeboers.nl - key: "{{ lookup('pipe', 'ssh-keyscan git.sgeboers.nl') }}" + name: "[git.sgeboers.nl]:222" + key: "{{ lookup('pipe', 'ssh-keyscan -p 222 git.sgeboers.nl') }}" state: present - name: pull latest code ansible.builtin.git: - repo: git@git.sgeboers.nl:sgeboers/motief.git + repo: ssh://git@git.sgeboers.nl:222/sgeboers/motief.git dest: ~/motief clone: yes force: yes