You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.0 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

# TODO: variabilize this
- name: "Download the binary"
get_url:
url: "https://dl.gitea.io/gitea/1.4/gitea-1.4-linux-amd64"
dest: /usr/local/bin/gitea
owner: root
group: root
mode: 0755
notify: "Restart gitea"
- name: "Installing git"
apt:
name: git
update_cache: yes
- include_tasks: create_user.yml
- name: "Create config and data directory"
file:
path: "{{ item }}"
state: directory
owner: "{{ gitea_user }}"
with_items:
- "/etc/gitea"
- "{{ gitea_home }}"
- "{{ gitea_home }}/data"
- "{{ gitea_home }}/custom"
- "{{ gitea_home }}/custom/https"
- "{{ gitea_home }}/custom/mailer"
# TODO: Support other systems than systemd
- include_tasks: install_systemd.yml
when: ansible_service_mgr == "systemd"
- name: "Configure gitea"
template:
src: gitea.ini.j2
dest: /etc/gitea/gitea.ini
owner: "{{ gitea_user }}"
mode: 0600
notify: "Restart gitea"
- name: "Service gitea"
service:
name: gitea
state: started
enabled: true