diff --git a/roles/gitea/tasks/enable.yml b/roles/gitea/tasks/enable.yml index 5bfd1d729..909b3b42d 100644 --- a/roles/gitea/tasks/enable.yml +++ b/roles/gitea/tasks/enable.yml @@ -26,7 +26,7 @@ src: /etc/{{ apache_config_dir }}/gitea.conf dest: /etc/apache2/sites-enabled/gitea.conf state: link - when: gitea_enabled and is_debuntu + when: gitea_enabled and not nginx_enabled - name: Remove apache httpd conf file (OS's other than debuntu) file: @@ -36,21 +36,19 @@ - name: Remove nginx httpd conf file file: - path: /etc/nginx/conf.d/gitea-nginx.conf + path: "{{ nginx_config_dir }}/gitea-nginx.conf" state: absent when: not gitea_enabled - name: Enable nginx httpd conf file template: src: gitea-nginx.conf.j2 - dest: /etc/nginx/conf.d/gitea-nginx.conf + dest: "{{ nginx_config_dir }}/gitea-nginx.conf" when: gitea_enabled and nginx_enabled -- name: >- - Restart Apache ({{ apache_service }}) to {% if gitea_enabled %}enable{% - else %}disable{% endif %} http://box/gitea +- name: Restart nginx systemd: - name: "{{ apache_service }}" + name: nginx daemon_reload: yes state: restarted