2020-01-11 22:04:29 +00:00
|
|
|
- name: Enable & Restart 'gitea' systemd service
|
2019-09-14 22:47:41 +00:00
|
|
|
systemd:
|
|
|
|
name: gitea
|
2020-01-11 22:04:29 +00:00
|
|
|
daemon_reload: yes
|
2019-09-14 22:47:41 +00:00
|
|
|
enabled: yes
|
|
|
|
state: restarted
|
|
|
|
when: gitea_enabled | bool
|
|
|
|
|
2020-01-11 22:04:29 +00:00
|
|
|
- name: Disable & Restart 'gitea' systemd service
|
2019-09-14 22:47:41 +00:00
|
|
|
systemd:
|
|
|
|
name: gitea
|
|
|
|
enabled: no
|
|
|
|
state: stopped
|
|
|
|
when: not gitea_enabled
|
|
|
|
|
2020-01-10 23:08:02 +00:00
|
|
|
# Apache
|
2019-09-14 22:47:41 +00:00
|
|
|
|
2020-01-11 22:04:29 +00:00
|
|
|
- name: Enable http://box{{ gitea_url }} via Apache # i.e. http://box/gitea
|
|
|
|
command: a2ensite gitea.conf
|
|
|
|
when: apache_install and gitea_enabled
|
2020-01-10 22:43:02 +00:00
|
|
|
|
2020-01-11 22:04:29 +00:00
|
|
|
- name: Disable http://box{{ gitea_url }} via Apache
|
|
|
|
command: a2dissite gitea.conf
|
|
|
|
when: apache_install and not gitea_enabled
|
2019-09-14 22:47:41 +00:00
|
|
|
|
2020-01-10 22:43:02 +00:00
|
|
|
- name: Restart Apache systemd service ({{ apache_service }})
|
|
|
|
systemd:
|
2020-01-11 22:04:29 +00:00
|
|
|
name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
|
2020-01-10 22:43:02 +00:00
|
|
|
state: restarted
|
2020-01-11 22:04:29 +00:00
|
|
|
when: apache_enabled | bool
|
2020-01-10 22:43:02 +00:00
|
|
|
|
2020-01-10 23:08:02 +00:00
|
|
|
# NGINX
|
2019-11-28 11:08:43 +00:00
|
|
|
|
2020-01-24 06:08:42 +00:00
|
|
|
- name: Enable http://box{{ gitea_url }} via NGINX, by installing {{ nginx_conf_dir }}/gitea-nginx.conf from template
|
2019-11-28 11:08:43 +00:00
|
|
|
template:
|
|
|
|
src: gitea-nginx.conf.j2
|
2020-01-24 06:08:42 +00:00
|
|
|
dest: "{{ nginx_conf_dir }}/gitea-nginx.conf"
|
2020-01-11 22:04:29 +00:00
|
|
|
when: nginx_install and gitea_enabled
|
|
|
|
|
2020-01-24 06:08:42 +00:00
|
|
|
- name: Disable http://box{{ gitea_url }} via NGINX, by removing {{ nginx_conf_dir }}/gitea-nginx.conf
|
2020-01-11 22:04:29 +00:00
|
|
|
file:
|
2020-01-24 06:08:42 +00:00
|
|
|
path: "{{ nginx_conf_dir }}/gitea-nginx.conf"
|
2020-01-11 22:04:29 +00:00
|
|
|
state: absent
|
|
|
|
when: nginx_install and not gitea_enabled
|
2019-09-14 22:47:41 +00:00
|
|
|
|
2020-01-11 22:04:29 +00:00
|
|
|
- name: Restart 'nginx' systemd service
|
2019-09-14 22:47:41 +00:00
|
|
|
systemd:
|
2020-01-04 01:37:41 +00:00
|
|
|
name: nginx
|
2019-09-14 22:47:41 +00:00
|
|
|
state: restarted
|
2020-01-10 22:43:02 +00:00
|
|
|
when: nginx_enabled | bool
|
2019-09-14 22:47:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
- name: Add 'gitea' to list of services at {{ iiab_ini_file }}
|
|
|
|
ini_file:
|
2020-01-10 23:18:54 +00:00
|
|
|
path: "{{ iiab_ini_file }}"
|
2019-09-14 22:47:41 +00:00
|
|
|
section: gitea
|
|
|
|
option: "{{ item.option }}"
|
2020-01-12 03:29:54 +00:00
|
|
|
value: "{{ item.value | string }}"
|
2019-09-14 22:47:41 +00:00
|
|
|
with_items:
|
|
|
|
- option: name
|
|
|
|
value: gitea
|
|
|
|
- option: description
|
2020-01-14 00:57:50 +00:00
|
|
|
value: '"Gitea is like GitHub for more offline communities: Git with a cup of tea"'
|
2019-09-14 22:47:41 +00:00
|
|
|
- option: gitea_run_directory
|
|
|
|
value: "{{ gitea_run_directory }}"
|
|
|
|
- option: gitea_url
|
|
|
|
value: "{{ gitea_url }}"
|
|
|
|
- option: gitea_enabled
|
|
|
|
value: "{{ gitea_enabled }}"
|