mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
Update gitea/tasks/enable.yml for Apache & NGINX
This commit is contained in:
parent
995d268bca
commit
30379d9cd3
1 changed files with 24 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
||||||
- name: Enable 'gitea' service
|
- name: Enable 'gitea' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
name: gitea
|
name: gitea
|
||||||
|
@ -6,7 +6,7 @@
|
||||||
state: restarted
|
state: restarted
|
||||||
when: gitea_enabled | bool
|
when: gitea_enabled | bool
|
||||||
|
|
||||||
- name: Disable 'gitea' service
|
- name: Disable 'gitea' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
name: gitea
|
name: gitea
|
||||||
|
@ -14,43 +14,53 @@
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not gitea_enabled
|
when: not gitea_enabled
|
||||||
|
|
||||||
# Configure HTTPD
|
# Configure Apache
|
||||||
|
|
||||||
- name: Copy gitea httpd conf file
|
- name: Remove softlink /etc/apache2/sites-enabled/gitea.conf
|
||||||
|
file:
|
||||||
|
path: /etc/apache2/sites-enabled/gitea.conf
|
||||||
|
state: absent
|
||||||
|
when: not gitea_enabled or nginx_enabled
|
||||||
|
|
||||||
|
- name: 'Install from template: /etc/{{ apache_config_dir }}/gitea.conf'
|
||||||
template:
|
template:
|
||||||
src: gitea.conf.j2
|
src: gitea.conf.j2
|
||||||
dest: "/etc/{{ apache_config_dir }}/gitea.conf"
|
dest: "/etc/{{ apache_config_dir }}/gitea.conf"
|
||||||
|
when: not nginx_enabled
|
||||||
|
|
||||||
- name: Enable httpd conf file (apache)
|
- name: Enable softlink /etc/apache2/sites-enabled/gitea.conf -> /etc/{{ apache_config_dir }}/gitea.conf
|
||||||
file:
|
file:
|
||||||
src: /etc/{{ apache_config_dir }}/gitea.conf
|
src: /etc/{{ apache_config_dir }}/gitea.conf
|
||||||
dest: /etc/apache2/sites-enabled/gitea.conf
|
dest: /etc/apache2/sites-enabled/gitea.conf
|
||||||
state: link
|
state: link
|
||||||
when: gitea_enabled and not nginx_enabled
|
when: gitea_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Remove apache httpd conf file (OS's other than debuntu)
|
- name: Restart Apache systemd service ({{ apache_service }})
|
||||||
file:
|
systemd:
|
||||||
path: /etc/apache2/sites-enabled/gitea.conf
|
name: "{{ apache_service }}" # httpd or apache2
|
||||||
state: absent
|
state: restarted
|
||||||
when: not gitea_enabled or nginx_enabled
|
when: not nginx_enabled
|
||||||
|
|
||||||
- name: Remove nginx httpd conf file
|
# Configure NGINX
|
||||||
|
|
||||||
|
- name: Remove {{ nginx_config_dir }}/gitea-nginx.conf
|
||||||
file:
|
file:
|
||||||
path: "{{ nginx_config_dir }}/gitea-nginx.conf"
|
path: "{{ nginx_config_dir }}/gitea-nginx.conf"
|
||||||
state: absent
|
state: absent
|
||||||
when: not gitea_enabled
|
when: not gitea_enabled or not nginx_enabled
|
||||||
|
|
||||||
- name: Enable nginx httpd conf file
|
- 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: gitea_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Restart nginx
|
- name: Restart nginx systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: nginx
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
|
when: nginx_enabled | bool
|
||||||
|
|
||||||
# Add Gitea to registry
|
# Add Gitea to registry
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue