- name: Enable 'gitea' systemd service systemd: daemon_reload: yes name: gitea enabled: yes state: restarted when: gitea_enabled | bool - name: Disable 'gitea' systemd service systemd: daemon_reload: yes name: gitea enabled: no state: stopped when: not gitea_enabled # Apache - 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: src: gitea.conf.j2 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 }}) systemd: name: "{{ apache_service }}" # httpd or apache2 state: restarted when: not nginx_enabled # NGINX - name: Remove {{ nginx_config_dir }}/gitea-nginx.conf 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: src: gitea-nginx.conf.j2 dest: "{{ nginx_config_dir }}/gitea-nginx.conf" when: gitea_enabled and nginx_enabled - name: Restart nginx systemd service systemd: name: nginx daemon_reload: yes state: restarted when: nginx_enabled | bool # Add Gitea to registry - name: Add 'gitea' to list of services at {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" section: gitea option: "{{ item.option }}" value: "{{ item.value }}" with_items: - option: name value: gitea - option: description value: '"Gitea: Git with a cup of tea"' - option: gitea_run_directory value: "{{ gitea_run_directory }}" - option: gitea_url value: "{{ gitea_url }}" - option: gitea_enabled value: "{{ gitea_enabled }}"