diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml deleted file mode 100644 index a5bfd8c..0000000 --- a/roles/common/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- name: Restart sshd service - become: true - ansible.builtin.systemd: - name: sshd - state: restarted diff --git a/roles/common_handlers/handlers/main.yml b/roles/common_handlers/handlers/main.yml index 6c87015..a9981f6 100644 --- a/roles/common_handlers/handlers/main.yml +++ b/roles/common_handlers/handlers/main.yml @@ -70,3 +70,9 @@ ansible.builtin.systemd: name: dovecot state: reloaded + +- name: Restart sshd service + become: true + ansible.builtin.systemd: + name: sshd + state: restarted diff --git a/roles/forgejo/tasks/ssh.yml b/roles/forgejo/tasks/ssh.yml index 9777cc6..0a26261 100644 --- a/roles/forgejo/tasks/ssh.yml +++ b/roles/forgejo/tasks/ssh.yml @@ -28,3 +28,13 @@ owner: git group: git mode: 0600 + +- name: Copy sshd_config + become: true + ansible.builtin.template: + src: sshd_config.j2 + dest: /etc/ssh/sshd_config.d/01-forgejo.conf + mode: "644" + owner: root + group: root + notify: Restart sshd service diff --git a/roles/forgejo/templates/sshd_config.j2 b/roles/forgejo/templates/sshd_config.j2 new file mode 100644 index 0000000..d863b61 --- /dev/null +++ b/roles/forgejo/templates/sshd_config.j2 @@ -0,0 +1,3 @@ +# {{ ansible_managed }} + +AcceptEnv GIT_PROTOCOL