mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
Update gitea/tasks/enable.yml
This commit is contained in:
parent
a99271e267
commit
b194a325b2
1 changed files with 20 additions and 34 deletions
|
@ -1,14 +1,13 @@
|
||||||
- name: Enable 'gitea' systemd service
|
- name: Enable & Restart 'gitea' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
|
||||||
name: gitea
|
name: gitea
|
||||||
|
daemon_reload: yes
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
when: gitea_enabled | bool
|
when: gitea_enabled | bool
|
||||||
|
|
||||||
- name: Disable 'gitea' systemd service
|
- name: Disable & Restart 'gitea' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
|
||||||
name: gitea
|
name: gitea
|
||||||
enabled: no
|
enabled: no
|
||||||
state: stopped
|
state: stopped
|
||||||
|
@ -16,53 +15,40 @@
|
||||||
|
|
||||||
# Apache
|
# Apache
|
||||||
|
|
||||||
- name: Remove softlink /etc/apache2/sites-enabled/gitea.conf
|
- name: Enable http://box{{ gitea_url }} via Apache # i.e. http://box/gitea
|
||||||
file:
|
command: a2ensite gitea.conf
|
||||||
path: /etc/apache2/sites-enabled/gitea.conf
|
when: apache_install and gitea_enabled
|
||||||
state: absent
|
|
||||||
when: not gitea_enabled or nginx_enabled
|
|
||||||
|
|
||||||
- name: 'Install from template: /etc/{{ apache_config_dir }}/gitea.conf'
|
- name: Disable http://box{{ gitea_url }} via Apache
|
||||||
template:
|
command: a2dissite gitea.conf
|
||||||
src: gitea.conf.j2
|
when: apache_install and not gitea_enabled
|
||||||
dest: "/etc/{{ apache_config_dir }}/gitea.conf"
|
|
||||||
when: not nginx_enabled
|
|
||||||
|
|
||||||
- name: Softlink /etc/apache2/sites-enabled/gitea.conf -> /etc/{{ apache_config_dir }}/gitea.conf
|
|
||||||
file:
|
|
||||||
src: /etc/{{ apache_config_dir }}/gitea.conf
|
|
||||||
path: /etc/apache2/sites-enabled/gitea.conf
|
|
||||||
state: link
|
|
||||||
when: gitea_enabled and not nginx_enabled
|
|
||||||
|
|
||||||
- name: Restart Apache systemd service ({{ apache_service }})
|
- name: Restart Apache systemd service ({{ apache_service }})
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}" # httpd or apache2
|
name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
|
||||||
state: restarted
|
state: restarted
|
||||||
when: not nginx_enabled
|
when: apache_enabled | bool
|
||||||
|
|
||||||
# NGINX
|
# NGINX
|
||||||
|
|
||||||
- name: Remove {{ nginx_config_dir }}/gitea-nginx.conf
|
- name: Enable http://box{{ gitea_url }} via NGINX, by installing {{ nginx_config_dir }}/gitea-nginx.conf from template
|
||||||
file:
|
|
||||||
path: "{{ nginx_config_dir }}/gitea-nginx.conf"
|
|
||||||
state: absent
|
|
||||||
when: not gitea_enabled or not nginx_enabled
|
|
||||||
|
|
||||||
- name: 'Install from template: {{ nginx_config_dir }}/gitea-nginx.conf'
|
|
||||||
template:
|
template:
|
||||||
src: gitea-nginx.conf.j2
|
src: gitea-nginx.conf.j2
|
||||||
dest: "{{ nginx_config_dir }}/gitea-nginx.conf"
|
dest: "{{ nginx_config_dir }}/gitea-nginx.conf"
|
||||||
when: gitea_enabled and nginx_enabled
|
when: nginx_install and gitea_enabled
|
||||||
|
|
||||||
- name: Restart nginx systemd service
|
- name: Disable http://box{{ gitea_url }} via NGINX, by removing {{ nginx_config_dir }}/gitea-nginx.conf
|
||||||
|
file:
|
||||||
|
path: "{{ nginx_config_dir }}/gitea-nginx.conf"
|
||||||
|
state: absent
|
||||||
|
when: nginx_install and not gitea_enabled
|
||||||
|
|
||||||
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: nginx
|
||||||
daemon_reload: yes
|
|
||||||
state: restarted
|
state: restarted
|
||||||
when: nginx_enabled | bool
|
when: nginx_enabled | bool
|
||||||
|
|
||||||
# Add Gitea to registry
|
|
||||||
|
|
||||||
- name: Add 'gitea' to list of services at {{ iiab_ini_file }}
|
- name: Add 'gitea' to list of services at {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
|
|
Loading…
Reference in a new issue