2017-01-10 15:09:34 -06:00
|
|
|
|
# TODO: variabilize this
|
|
|
|
|
- name: "Download the binary"
|
|
|
|
|
get_url:
|
2019-01-07 07:56:08 -06:00
|
|
|
|
url: "https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-{{ 'amd64' if ansible_architecture == 'x86_64' else ansible_architecture }}"
|
2017-01-10 15:09:34 -06:00
|
|
|
|
dest: /usr/local/bin/gitea
|
|
|
|
|
owner: root
|
|
|
|
|
group: root
|
|
|
|
|
mode: 0755
|
2019-01-07 07:56:08 -06:00
|
|
|
|
force: yes
|
2017-01-10 15:09:34 -06:00
|
|
|
|
notify: "Restart gitea"
|
|
|
|
|
|
|
|
|
|
- include: 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: 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
|
2019-03-08 06:12:16 -06:00
|
|
|
|
|
|
|
|
|
- include: fail2ban.yml
|
2019-03-09 14:40:56 -06:00
|
|
|
|
when: gitea_fail2ban_enabled
|