mirror of
https://github.com/roles-ansible/ansible_role_gitea.git
synced 2024-08-16 11:39:50 +02:00
168be1f6bb
* added a license info * added galaxy tags/platforms * added travis test support * testing the playbook using molecule
46 lines
1 KiB
YAML
46 lines
1 KiB
YAML
---
|
|
- name: "Download the binary"
|
|
get_url:
|
|
url: "{{ gitea_dl_url }}/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-{{ gitea_arch }}"
|
|
dest: /usr/local/bin/gitea
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
force: true
|
|
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"
|
|
|
|
- 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
|
|
when: ansible_service_mgr == "systemd"
|
|
|
|
- include: fail2ban.yml
|
|
when: gitea_fail2ban_enabled
|