fix(ansible): use port 222 for Gitea SSH, write SSH config on server
This commit is contained in:
+15
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user