1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-14 20:22:08 +00:00

gitea - iiab_installed

This commit is contained in:
Jerry Vonau 2019-09-14 17:47:41 -05:00
parent 3a251be789
commit 544293113f
3 changed files with 74 additions and 62 deletions

View file

@ -0,0 +1,63 @@
- name: Enable 'gitea' service
systemd:
daemon_reload: yes
name: gitea
enabled: yes
state: restarted
when: gitea_enabled | bool
- name: Disable 'gitea' service
systemd:
daemon_reload: yes
name: gitea
enabled: no
state: stopped
when: not gitea_enabled
# Configure HTTPD
- name: Copy gitea httpd conf file
template:
src: gitea.conf.j2
dest: "/etc/{{ apache_config_dir }}/gitea.conf"
- name: Enable httpd conf file (debuntu)
file:
src: /etc/{{ apache_config_dir }}/gitea.conf
dest: /etc/apache2/sites-enabled/gitea.conf
state: link
when: gitea_enabled and is_debuntu
- name: Remove httpd conf file (OS's other than debuntu)
file:
path: /etc/apache2/sites-enabled/gitea.conf
state: absent
when: not gitea_enabled and is_debuntu
- name: >-
Restart Apache ({{ apache_service }}) to {% if gitea_enabled %}enable{%
else %}disable{% endif %} http://box/gitea
systemd:
name: "{{ apache_service }}"
daemon_reload: yes
state: restarted
# Add Gitea to registry
- name: Add 'gitea' to list of services at {{ iiab_ini_file }}
ini_file:
dest: "{{ 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 }}"

View file

@ -125,64 +125,9 @@
tags:
- systemd
- name: Enable 'gitea' service
systemd:
daemon_reload: yes
name: gitea
enabled: yes
state: restarted
when: gitea_enabled | bool
- name: Disable 'gitea' service
systemd:
name: gitea
enabled: no
state: stopped
when: not gitea_enabled
# Configure HTTPD
- name: Copy gitea httpd conf file
template:
src: gitea.conf.j2
dest: "/etc/{{ apache_config_dir }}/gitea.conf"
- name: Enable httpd conf file (debuntu)
file:
src: /etc/{{ apache_config_dir }}/gitea.conf
dest: /etc/apache2/sites-enabled/gitea.conf
state: link
when: gitea_enabled and is_debuntu
- name: Remove httpd conf file (OS's other than debuntu)
file:
path: /etc/apache2/sites-enabled/gitea.conf
state: absent
when: not gitea_enabled and is_debuntu
- name: >-
Restart Apache ({{ apache_service }}) to {% if gitea_enabled %}enable{%
else %}disable{% endif %} http://box/gitea
service:
name: "{{ apache_service }}"
state: restarted
# Add Gitea to registry
- name: Add 'gitea' to list of services at {{ iiab_ini_file }}
ini_file:
dest: "{{ 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 }}"
- name: Add 'gitea_installed' variable values to {{ iiab_installed }}
lineinfile:
dest: "{{ iiab_installed }}"
regexp: '^gitea_installed'
line: 'gitea_installed'
state: present

View file

@ -1,3 +1,7 @@
- name: Install Gitea {{ gitea_version }} if gitea_install
include_tasks: install.yml
when: gitea_install | bool
when: gitea_install | bool and not gitea_installed is defined
- name: Enable Gitea {{ gitea_version }} if gitea_install
include_tasks: enabled.yml
when: gitea_install | bool or gitea_installed is defined