servers/services/gitea/tasks/setup.yml
2021-03-12 22:33:50 +01:00

35 lines
758 B
YAML

---
- name: 'Ensure repositories directory exists'
file:
path: "{{ repositories_path }}"
state: directory
owner: "{{ ansible_user }}"
- name: 'Create git user for ssh access'
user:
name: git
shell: /bin/bash
system: yes
password: '!'
state: present
generate_ssh_key: yes
register: git_user
- name: 'Add host key for gitea SSH passthrough'
ansible.posix.authorized_key:
user: "{{ git_user.name }}"
key: "{{ git_user.ssh_public_key }}"
state: present
manage_dir: False
- name: 'Ensure /app/gitea exists'
file:
path: "/app/gitea"
state: directory
- name: 'Copy gitea-ssh-forward script to remote'
copy:
src: "{{ service_path }}/bin/gitea-ssh-forward"
dest: "/app/gitea/gitea"