Compare commits
12 Commits
tpiccioli-
...
master
Author | SHA1 | Date |
---|---|---|
|
99690f5790 | |
|
0f821d89bc | |
|
fbcc560820 | |
|
655394009e | |
|
07062187d0 | |
|
afed82bf44 | |
|
ff5ce5467a | |
|
d3f0dd393c | |
|
65a44ffc32 | |
|
36fd443b9c | |
|
80de76635f | |
|
eefd2438a4 |
14
README.md
14
README.md
|
@ -9,13 +9,13 @@ Role Variables
|
||||||
The most important variables are listed below:
|
The most important variables are listed below:
|
||||||
|
|
||||||
``` yaml
|
``` yaml
|
||||||
gitea_version: 1.14.3
|
gitea_version: 1.21.11
|
||||||
gitea_local_postgresql: True
|
gitea_local_postgresql: true
|
||||||
gitea_local_mysql: False
|
gitea_local_mysql: false
|
||||||
gitea_local_mariadb: False
|
gitea_local_mariadb: false
|
||||||
gitea_nginx_frontend: True
|
gitea_nginx_frontend: true
|
||||||
gitea_local_redis: True
|
gitea_local_redis: true
|
||||||
gitea_local_memcache: True
|
gitea_local_memcache: true
|
||||||
gitea_app_configurations:
|
gitea_app_configurations:
|
||||||
- { section: 'mailer', option: 'ENABLED', value: 'true', state: 'present' }
|
- { section: 'mailer', option: 'ENABLED', value: 'true', state: 'present' }
|
||||||
- { section: 'mailer', option: 'FROM', value: '{{ gitea_mail_from }}', state: 'present' }
|
- { section: 'mailer', option: 'FROM', value: '{{ gitea_mail_from }}', state: 'present' }
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# We use the server ssh daemon, and nginx in front of the service by default.
|
# We use the server ssh daemon, and nginx in front of the service by default.
|
||||||
# So we do not start in http mode and we do not use the embedded letsencrypt support
|
# So we do not start in http mode and we do not use the embedded letsencrypt support
|
||||||
#
|
#
|
||||||
gitea_version: 1.19.4
|
gitea_version: 1.21.11
|
||||||
gitea_download_url: 'https://dl.gitea.io/gitea/{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64'
|
gitea_download_url: 'https://dl.gitea.io/gitea/{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64'
|
||||||
gitea_force_binary_download: False
|
gitea_force_binary_download: False
|
||||||
gitea_bin_path: /usr/local/bin/gitea
|
gitea_bin_path: /usr/local/bin/gitea
|
||||||
|
@ -22,7 +22,7 @@ gitea_socket_dir: /run/gitea
|
||||||
gitea_repository_data: '{{ gitea_data_dir }}/repositories'
|
gitea_repository_data: '{{ gitea_data_dir }}/repositories'
|
||||||
gitea_max_repository_per_user: 200
|
gitea_max_repository_per_user: 200
|
||||||
|
|
||||||
gitea_server_protocol: unix
|
gitea_server_protocol: "http+unix"
|
||||||
gitea_hostname: '{{ ansible_fqdn }}'
|
gitea_hostname: '{{ ansible_fqdn }}'
|
||||||
gitea_http_addr: '{{ gitea_socket_dir }}/gitea.sock'
|
gitea_http_addr: '{{ gitea_socket_dir }}/gitea.sock'
|
||||||
gitea_http_port: 3000
|
gitea_http_port: 3000
|
||||||
|
@ -34,6 +34,8 @@ gitea_create_service_user: True
|
||||||
gitea_user: gitea
|
gitea_user: gitea
|
||||||
gitea_group: '{{ gitea_user }}'
|
gitea_group: '{{ gitea_user }}'
|
||||||
gitea_run_mode: prod
|
gitea_run_mode: prod
|
||||||
|
gitea_limit_nofile: 16384
|
||||||
|
gitea_limit_nofile_soft: 4096
|
||||||
gitea_db: postgres
|
gitea_db: postgres
|
||||||
gitea_local_postgresql: True
|
gitea_local_postgresql: True
|
||||||
gitea_local_mysql: False
|
gitea_local_mysql: False
|
||||||
|
@ -46,6 +48,11 @@ gitea_start_lfs: 'true'
|
||||||
gitea_lfs_content_path: '{{ gitea_data_dir }}/data/lfs'
|
gitea_lfs_content_path: '{{ gitea_data_dir }}/data/lfs'
|
||||||
#gitea_lfs_jwt_secret: put it into a vault file
|
#gitea_lfs_jwt_secret: put it into a vault file
|
||||||
gitea_lfs_http_auth_expiry: 20m
|
gitea_lfs_http_auth_expiry: 20m
|
||||||
|
gitea_lfs_configuration:
|
||||||
|
- { section: 'server', option: 'LFS_START_SERVER', value: '{{ gitea_start_lfs }}', state: 'present' }
|
||||||
|
- { section: 'server', option: 'LFS_HTTP_AUTH_EXPIRY', value: '{{ gitea_lfs_http_auth_expiry }}', state: 'present' }
|
||||||
|
- { section: 'server', option: 'LFS_CONTENT_PATH', value: '{{ gitea_lfs_content_path }}', state: 'absent' }
|
||||||
|
- { section: 'lfs', option: 'PATH', value: '{{ gitea_lfs_content_path }}', state: 'present' }
|
||||||
|
|
||||||
gitea_required_packages:
|
gitea_required_packages:
|
||||||
- git
|
- git
|
||||||
|
@ -53,11 +60,11 @@ gitea_required_packages:
|
||||||
gitea_db_name: gitea
|
gitea_db_name: gitea
|
||||||
gitea_db_user: gitea_u
|
gitea_db_user: gitea_u
|
||||||
#gitea_db_pwd: put it into a vault file
|
#gitea_db_pwd: put it into a vault file
|
||||||
gitea_db_host: postgres.priv.isti.cnr.it
|
gitea_db_host: "localhost"
|
||||||
gitea_db_port: 5432
|
gitea_db_port: 5432
|
||||||
gitea_db_ssl_mode: 'disable'
|
gitea_db_ssl_mode: 'disable'
|
||||||
|
|
||||||
gitea_app_name: "Gitea"
|
gitea_app_name: "Gitea git server"
|
||||||
gitea_disable_registration: 'false'
|
gitea_disable_registration: 'false'
|
||||||
gitea_install_lock: 'false'
|
gitea_install_lock: 'false'
|
||||||
gitea_mailer_enabled: False
|
gitea_mailer_enabled: False
|
||||||
|
@ -137,8 +144,8 @@ gitea_app_configurations:
|
||||||
- { section: 'log', option: 'COLORIZE', value: 'false', state: 'present' }
|
- { section: 'log', option: 'COLORIZE', value: 'false', state: 'present' }
|
||||||
- { section: 'log', option: 'LEVEL', value: '{{ gitea_log_level }}', state: 'present' }
|
- { section: 'log', option: 'LEVEL', value: '{{ gitea_log_level }}', state: 'present' }
|
||||||
- { section: 'log', option: 'FILE_NAME', value: '{{ gitea_log_dir }}/gitea.log', state: 'present' }
|
- { section: 'log', option: 'FILE_NAME', value: '{{ gitea_log_dir }}/gitea.log', state: 'present' }
|
||||||
- { section: 'log', option: 'ENABLE_XORM_LOG', value: 'true', state: 'present' }
|
- { section: 'log', option: 'ENABLE_XORM_LOG', value: 'true', state: 'absent' }
|
||||||
- { section: 'log', option: 'ENABLE_ACCESS_LOG', value: 'true', state: 'present' }
|
- { section: 'log', option: 'ENABLE_ACCESS_LOG', value: 'true', state: 'absent' }
|
||||||
- { section: 'log.sublogger.router', option: 'FILE_NAME', value: '{{ gitea_log_dir }}/router.log', state: 'present' }
|
- { section: 'log.sublogger.router', option: 'FILE_NAME', value: '{{ gitea_log_dir }}/router.log', state: 'present' }
|
||||||
- { section: 'log.sublogger.access', option: 'FILE_NAME', value: '{{ gitea_log_dir }}/access.log', state: 'present' }
|
- { section: 'log.sublogger.access', option: 'FILE_NAME', value: '{{ gitea_log_dir }}/access.log', state: 'present' }
|
||||||
- { section: 'log.sublogger.xorm', option: 'FILE_NAME', value: '{{ gitea_log_dir }}/xorm.log', state: 'present' }
|
- { section: 'log.sublogger.xorm', option: 'FILE_NAME', value: '{{ gitea_log_dir }}/xorm.log', state: 'present' }
|
||||||
|
@ -148,7 +155,20 @@ gitea_app_configurations:
|
||||||
- { section: 'session', option: 'COOKIE_SECURE', value: 'false', state: 'present'}
|
- { section: 'session', option: 'COOKIE_SECURE', value: 'false', state: 'present'}
|
||||||
# - { section: 'mailer', option: 'ENABLED', value: 'true', state: 'present' }
|
# - { section: 'mailer', option: 'ENABLED', value: 'true', state: 'present' }
|
||||||
# - { section: 'mailer', option: 'FROM', value: '{{ gitea_mail_from }}', state: 'present' }
|
# - { section: 'mailer', option: 'FROM', value: '{{ gitea_mail_from }}', state: 'present' }
|
||||||
# - { section: 'mailer', option: 'MAILER_TYPE', value: '{{ gitea_mailer_type }}', state: 'present' }
|
# - { section: 'mailer', option: 'MAILER_PROTOCOL', value: '{{ gitea_mailer_type }}', state: 'present' }
|
||||||
# - { section: 'mailer', option: 'SENDMAIL_PATH', value: '{{ gitea_sendmail_path }}', state: 'present' }
|
# - { section: 'mailer', option: 'SENDMAIL_PATH', value: '{{ gitea_sendmail_path }}', state: 'present' }
|
||||||
# - { section: 'metrics', option: 'ENABLED', value: 'true', state: 'present' }
|
# - { section: 'metrics', option: 'ENABLED', value: 'true', state: 'present' }
|
||||||
# - { section: 'metrics', option: 'TOKEN', value: '{{ gitea_prometheus_bearer_token }}', state: 'present' }
|
# - { section: 'metrics', option: 'TOKEN', value: '{{ gitea_prometheus_bearer_token }}', state: 'present' }
|
||||||
|
|
||||||
|
gitea_enable_repository_archives_cron_jobs: true
|
||||||
|
gitea_delete_repo_archives_frequency: "@weekly"
|
||||||
|
gitea_rep_archives_configuration:
|
||||||
|
- { section: 'cron.archive_cleanup', option: 'ENABLED', value: 'true', state: 'present' }
|
||||||
|
- { section: 'cron.archive_cleanup', option: 'RUN_AT_START', value: 'false', state: 'present' }
|
||||||
|
- { section: 'cron.archive_cleanup', option: 'NOTICE_ON_SUCCESS', value: 'false', state: 'present' }
|
||||||
|
- { section: 'cron.archive_cleanup', option: 'SCHEDULE', value: '@midnight', state: 'present' }
|
||||||
|
- { section: 'cron.archive_cleanup', option: 'OLDER_THAN', value: '24h', state: 'present' }
|
||||||
|
- { section: 'cron.delete_repo_archives', option: 'ENABLED', value: 'true', state: 'present' }
|
||||||
|
- { section: 'cron.delete_repo_archives', option: 'RUN_AT_START', value: 'false', state: 'present' }
|
||||||
|
- { section: 'cron.delete_repo_archives', option: 'NOTICE_ON_SUCCESS', value: 'false', state: 'present' }
|
||||||
|
- { section: 'cron.delete_repo_archives', option: 'SCHEDULE', value: '{{ gitea_delete_repo_archives_frequency }}', state: 'present' }
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<!-- lets import the less stylesheet {{AppSubUrl}} is a variable that gitea will autofill -->
|
<!-- lets import the less stylesheet {{AppSubUrl}} is a variable that gitea will autofill -->
|
||||||
<link rel="stylesheet" type="text/css" href="{{AppSubUrl}}/css/jupyter.css" />
|
<link rel="stylesheet" type="text/css" href="{{AppSubUrl}}/assets/css/jupyter.css" />
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
---
|
---
|
||||||
- name: reload gitea
|
- name: Reload gitea
|
||||||
service: name=gitea state=reloaded
|
ansible.builtin.service:
|
||||||
|
name: gitea
|
||||||
|
state: reloaded
|
||||||
|
|
||||||
- name: restart gitea
|
- name: Restart gitea
|
||||||
service: name=gitea state=restarted
|
ansible.builtin.service:
|
||||||
|
name: gitea
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
- name: Reload the systemd configuration
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
daemon-reload: true
|
||||||
|
|
|
@ -7,7 +7,7 @@ galaxy_info:
|
||||||
|
|
||||||
license: EUPL 1.2+
|
license: EUPL 1.2+
|
||||||
|
|
||||||
min_ansible_version: "2.8"
|
min_ansible_version: "2.9"
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
|
|
281
tasks/gitea.yml
281
tasks/gitea.yml
|
@ -1,126 +1,191 @@
|
||||||
---
|
---
|
||||||
- block:
|
- name: gitea | Manage the gitea installation and configuration
|
||||||
- name: Create the gitea service user
|
tags: ['git', 'gitea']
|
||||||
user: name={{ gitea_user }} home=/srv/gitea createhome=yes shell=/bin/bash system=yes
|
block:
|
||||||
when: gitea_create_service_user
|
- name: gitea | Create the gitea service user
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ gitea_user }}"
|
||||||
|
home: /srv/gitea
|
||||||
|
createhome: true
|
||||||
|
shell: /bin/bash
|
||||||
|
system: true
|
||||||
|
when: gitea_create_service_user
|
||||||
|
|
||||||
- name: Create the gitea directory tree
|
- name: gitea | Create the gitea directory tree
|
||||||
file: dest={{ gitea_data_dir }}/{{ item }} state=directory owner={{ gitea_user }} group={{ gitea_group }}
|
ansible.builtin.file:
|
||||||
with_items: '{{ gitea_data_subdirs }}'
|
dest: "{{ gitea_data_dir }}/{{ item }}"
|
||||||
when: gitea_create_service_user
|
state: directory
|
||||||
|
owner: "{{ gitea_user }}"
|
||||||
|
group: "{{ gitea_group }}"
|
||||||
|
mode: "0750"
|
||||||
|
loop: '{{ gitea_data_subdirs }}'
|
||||||
|
when: gitea_create_service_user
|
||||||
|
|
||||||
- name: Create the gitea subdirs when we are using a pre existing user
|
- name: gitea | Create the gitea subdirs when we are using a pre existing user
|
||||||
become: True
|
become: true
|
||||||
become_user: '{{ gitea_user }}'
|
become_user: '{{ gitea_user }}'
|
||||||
file: dest={{ gitea_data_dir }}/{{ item }} state=directory
|
ansible.builtin.file:
|
||||||
with_items: '{{ gitea_data_subdirs }}'
|
dest: "{{ gitea_data_dir }}/{{ item }}"
|
||||||
when: not gitea_create_service_user
|
state: directory
|
||||||
|
mode: "0750"
|
||||||
|
with_items: '{{ gitea_data_subdirs }}'
|
||||||
|
when: not gitea_create_service_user
|
||||||
|
|
||||||
- name: Create the gitea conf directory
|
- name: gitea | Create the gitea conf directory
|
||||||
file: dest={{ gitea_conf_dir }} state=directory owner=root group={{ gitea_group }} mode=0750
|
ansible.builtin.file:
|
||||||
|
dest: "{{ gitea_conf_dir }}"
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: "{{ gitea_group }}"
|
||||||
|
mode: "0750"
|
||||||
|
|
||||||
- name: Create the gitea socket directory
|
- name: gitea | Create the gitea socket directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
dest: '{{ gitea_socket_dir }}'
|
dest: '{{ gitea_socket_dir }}'
|
||||||
state: directory
|
state: directory
|
||||||
owner: '{{ gitea_user }}'
|
owner: '{{ gitea_user }}'
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: 0755
|
mode: "0755"
|
||||||
|
|
||||||
- name: Create the gitea log directory
|
- name: gitea | Create the gitea log directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
dest: '{{ gitea_log_dir }}'
|
dest: '{{ gitea_log_dir }}'
|
||||||
state: directory
|
state: directory
|
||||||
owner: '{{ gitea_user }}'
|
owner: '{{ gitea_user }}'
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: 0755
|
mode: "0755"
|
||||||
|
|
||||||
- name: Download the gitea binary
|
- name: gitea | Download the gitea binary
|
||||||
get_url:
|
ansible.builtin.get_url:
|
||||||
url: '{{ gitea_download_url }}'
|
url: '{{ gitea_download_url }}'
|
||||||
dest: '{{ gitea_bin_path }}'
|
dest: '{{ gitea_bin_path }}'
|
||||||
owner: root
|
owner: root
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: 0750
|
mode: "0750"
|
||||||
notify: restart gitea
|
notify: Restart gitea
|
||||||
|
|
||||||
- name: Force the download of the gitea binary to upgrade it
|
- name: gitea | Force the download of the gitea binary to upgrade it
|
||||||
get_url:
|
ansible.builtin.get_url:
|
||||||
url: '{{ gitea_download_url }}'
|
url: '{{ gitea_download_url }}'
|
||||||
dest: '{{ gitea_bin_path }}'
|
dest: '{{ gitea_bin_path }}'
|
||||||
owner: root
|
owner: root
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: 0750
|
mode: "0750"
|
||||||
force: true
|
force: true
|
||||||
when: gitea_force_binary_download
|
when: gitea_force_binary_download
|
||||||
|
|
||||||
- name: Install the required packages
|
- name: gitea | Install the required packages
|
||||||
package: state=present use=auto name={{ gitea_required_packages }}
|
ansible.builtin.package:
|
||||||
|
state: present
|
||||||
|
use: auto
|
||||||
|
name: "{{ gitea_required_packages }}"
|
||||||
|
|
||||||
- name: Install the gitea configuration file. At install time only
|
- name: gitea | Install the gitea configuration file. At install time only
|
||||||
template: src=app.ini.j2 dest={{ gitea_conf_dir }}/app.ini owner={{ gitea_user }} group={{ gitea_group }} mode=0640 force=no
|
ansible.builtin.template:
|
||||||
notify: restart gitea
|
src: app.ini.j2
|
||||||
|
dest: "{{ gitea_conf_dir }}/app.ini"
|
||||||
|
owner: "{{ gitea_user }}"
|
||||||
|
group: "{{ gitea_group }}"
|
||||||
|
mode: "0640"
|
||||||
|
force: false
|
||||||
|
notify: Restart gitea
|
||||||
|
|
||||||
- name: Change the gitea configuration. After the installation
|
- name: gitea | Manage the gitea configuration settings
|
||||||
ini_file:
|
tags: [git, gitea, gitea_conf]
|
||||||
path: '{{ gitea_conf_dir }}/app.ini'
|
block:
|
||||||
section: '{{ item.section }}'
|
- name: gitea | Create the tmpfile entry for the gitea socket directory
|
||||||
option: '{{ item.option }}'
|
ansible.builtin.template:
|
||||||
value: '{{ item.value }}'
|
src: tmpfile_gitea.conf.j2
|
||||||
state: '{{ item.state }}'
|
dest: /usr/lib/tmpfiles.d/gitea.conf
|
||||||
owner: '{{ gitea_user }}'
|
owner: root
|
||||||
group: '{{ gitea_group }}'
|
group: root
|
||||||
mode: '0640'
|
mode: "0644"
|
||||||
create: no
|
|
||||||
loop: '{{ gitea_app_configurations }}'
|
|
||||||
when: gitea_app_configurations is defined
|
|
||||||
notify: restart gitea
|
|
||||||
tags: [ 'git', 'gitea', 'gitea_conf' ]
|
|
||||||
|
|
||||||
- name: Prometheus metrics
|
- name: gitea | Create some custom subdirectories
|
||||||
ini_file:
|
become: true
|
||||||
path: '{{ gitea_conf_dir }}/app.ini'
|
become_user: '{{ gitea_user }}'
|
||||||
section: '{{ item.section }}'
|
ansible.builtin.file:
|
||||||
option: '{{ item.option }}'
|
dest: '{{ gitea_data_dir }}/custom/{{ item }}'
|
||||||
value: '{{ item.value }}'
|
state: directory
|
||||||
state: '{{ item.state }}'
|
mode: "0750"
|
||||||
owner: '{{ gitea_user }}'
|
loop:
|
||||||
group: '{{ gitea_group }}'
|
- 'templates/custom'
|
||||||
mode: '0640'
|
- 'public/assets/css'
|
||||||
create: no
|
- 'public/assets/components'
|
||||||
loop: '{{ gitea_prometheus_conf }}'
|
|
||||||
notify: restart gitea
|
|
||||||
tags: [ 'git', 'gitea', 'gitea_conf' ]
|
|
||||||
|
|
||||||
- name: Create the tmpfile entry for the gitea socket directory
|
- name: gitea | Change the gitea configuration. After the installation
|
||||||
template:
|
community.general.ini_file:
|
||||||
src: tmpfile_gitea.conf.j2
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
dest: /usr/lib/tmpfiles.d/gitea.conf
|
section: '{{ item.section }}'
|
||||||
owner: root
|
option: '{{ item.option }}'
|
||||||
group: root
|
value: '{{ item.value }}'
|
||||||
mode: 0644
|
state: '{{ item.state }}'
|
||||||
|
owner: '{{ gitea_user }}'
|
||||||
|
group: '{{ gitea_group }}'
|
||||||
|
mode: '0640'
|
||||||
|
create: false
|
||||||
|
loop: '{{ gitea_app_configurations }}'
|
||||||
|
when: gitea_app_configurations is defined
|
||||||
|
notify: Restart gitea
|
||||||
|
|
||||||
- name: Create some custom subdirectories
|
- name: gitea | Prometheus metrics
|
||||||
become: true
|
community.general.ini_file:
|
||||||
become_user: '{{ gitea_user }}'
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
file:
|
section: '{{ item.section }}'
|
||||||
dest: '{{ gitea_data_dir }}/custom/{{ item }}'
|
option: '{{ item.option }}'
|
||||||
state: directory
|
value: '{{ item.value }}'
|
||||||
loop:
|
state: '{{ item.state }}'
|
||||||
- 'templates/custom'
|
owner: '{{ gitea_user }}'
|
||||||
- 'public/css'
|
group: '{{ gitea_group }}'
|
||||||
- 'public/components'
|
mode: '0640'
|
||||||
tags: [ 'git', 'gitea', 'gitea_conf' ]
|
create: false
|
||||||
|
loop: '{{ gitea_prometheus_conf }}'
|
||||||
|
notify: Restart gitea
|
||||||
|
|
||||||
- name: Install the gitea systemd unit
|
- name: gitea | Configure some repository archives cron jobs
|
||||||
template: src=gitea.service.systemd.j2 dest=/etc/systemd/system/gitea.service
|
community.general.ini_file:
|
||||||
register: gitea_systemd_unit
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
|
section: '{{ item.section }}'
|
||||||
|
option: '{{ item.option }}'
|
||||||
|
value: '{{ item.value }}'
|
||||||
|
state: '{{ item.state }}'
|
||||||
|
owner: '{{ gitea_user }}'
|
||||||
|
group: '{{ gitea_group }}'
|
||||||
|
mode: '0640'
|
||||||
|
create: false
|
||||||
|
loop: '{{ gitea_rep_archives_configuration }}'
|
||||||
|
when: gitea_enable_repository_archives_cron_jobs
|
||||||
|
notify: Restart gitea
|
||||||
|
|
||||||
- name: Reload the systemd configuration
|
- name: gitea | LFS configuration
|
||||||
command: systemctl daemon-reload
|
community.general.ini_file:
|
||||||
when: gitea_systemd_unit is changed
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
|
section: '{{ item.section }}'
|
||||||
|
option: '{{ item.option }}'
|
||||||
|
value: '{{ item.value }}'
|
||||||
|
state: '{{ item.state }}'
|
||||||
|
owner: '{{ gitea_user }}'
|
||||||
|
group: '{{ gitea_group }}'
|
||||||
|
mode: '0640'
|
||||||
|
create: false
|
||||||
|
loop: '{{ gitea_lfs_configuration }}'
|
||||||
|
notify: Restart gitea
|
||||||
|
|
||||||
- name: Ensure that the gitea service is running and enabled
|
- name: gitea | Gitea systemd service
|
||||||
service: name=gitea state=started enabled=yes
|
tags: ['git', 'gitea', 'gitea_service']
|
||||||
|
block:
|
||||||
|
- name: gitea | Install the gitea systemd unit
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: gitea.service.systemd.j2
|
||||||
|
dest: /etc/systemd/system/gitea.service
|
||||||
|
mode: "0644"
|
||||||
|
notify: Reload the systemd configuration
|
||||||
|
|
||||||
tags: [ 'git', 'gitea' ]
|
- name: gitea | Flush the handlers
|
||||||
|
ansible.builtin.meta: flush_handlers
|
||||||
|
|
||||||
|
- name: gitea | Ensure that the gitea service is running and enabled
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: gitea
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
---
|
---
|
||||||
- name: Global renderers config
|
- name: renderers | Global renderers config
|
||||||
|
tags: ['git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_renderers']
|
||||||
block:
|
block:
|
||||||
- name: Global renderers config
|
- name: renderers | Global renderers config
|
||||||
ini_file:
|
community.general.ini_file:
|
||||||
path: '{{ gitea_conf_dir }}/app.ini'
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
section: '{{ item.section }}'
|
section: '{{ item.section }}'
|
||||||
option: '{{ item.option }}'
|
option: '{{ item.option }}'
|
||||||
|
@ -11,17 +12,16 @@
|
||||||
owner: '{{ gitea_user }}'
|
owner: '{{ gitea_user }}'
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
create: no
|
create: false
|
||||||
loop: '{{ gitea_renderers_global_conf }}'
|
loop: '{{ gitea_renderers_global_conf }}'
|
||||||
when: gitea_install_viewer_addons
|
when: gitea_install_viewer_addons
|
||||||
notify: restart gitea
|
notify: Restart gitea
|
||||||
|
|
||||||
tags: [ 'git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_renderers' ]
|
- name: renderers | Configure asciidoc
|
||||||
|
tags: ['git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_asciidoc']
|
||||||
- name: Configure asciidoc
|
|
||||||
block:
|
block:
|
||||||
- name: Configure asciidoc
|
- name: renderers | Configure asciidoc
|
||||||
ini_file:
|
community.general.ini_file:
|
||||||
path: '{{ gitea_conf_dir }}/app.ini'
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
section: '{{ item.section }}'
|
section: '{{ item.section }}'
|
||||||
option: '{{ item.option }}'
|
option: '{{ item.option }}'
|
||||||
|
@ -30,17 +30,16 @@
|
||||||
owner: '{{ gitea_user }}'
|
owner: '{{ gitea_user }}'
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
create: no
|
create: false
|
||||||
loop: '{{ gitea_markup_asciidoc_conf }}'
|
loop: '{{ gitea_markup_asciidoc_conf }}'
|
||||||
when: gitea_install_viewer_addons
|
when: gitea_install_viewer_addons
|
||||||
notify: restart gitea
|
notify: Restart gitea
|
||||||
|
|
||||||
tags: [ 'git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_asciidoc' ]
|
- name: renderers | Configure jupyter markup
|
||||||
|
tags: ['git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_jupyter']
|
||||||
- name: Configure jupyter markup
|
|
||||||
block:
|
block:
|
||||||
- name: Configure jupyter markup
|
- name: renderers | Configure jupyter markup
|
||||||
ini_file:
|
community.general.ini_file:
|
||||||
path: '{{ gitea_conf_dir }}/app.ini'
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
section: '{{ item.section }}'
|
section: '{{ item.section }}'
|
||||||
option: '{{ item.option }}'
|
option: '{{ item.option }}'
|
||||||
|
@ -49,47 +48,46 @@
|
||||||
owner: '{{ gitea_user }}'
|
owner: '{{ gitea_user }}'
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
create: no
|
create: false
|
||||||
loop: '{{ gitea_markup_jupyter_conf }}'
|
loop: '{{ gitea_markup_jupyter_conf }}'
|
||||||
when: gitea_install_viewer_addons
|
when: gitea_install_viewer_addons
|
||||||
notify: restart gitea
|
notify: Restart gitea
|
||||||
|
|
||||||
- name: Install the jupyter CSS
|
- name: renderers | Install the jupyter CSS
|
||||||
become: true
|
become: true
|
||||||
become_user: '{{ gitea_user }}'
|
become_user: '{{ gitea_user }}'
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: jupyter.css
|
src: jupyter.css
|
||||||
dest: '{{ gitea_data_dir }}/custom/public/css/jupyter.css'
|
dest: '{{ gitea_data_dir }}/custom/public/assets/css/jupyter.css'
|
||||||
mode: 0444
|
mode: "0444"
|
||||||
|
|
||||||
- name: Install html template that loads the CSS
|
- name: renderers | Install html template that loads the CSS
|
||||||
become: true
|
become: true
|
||||||
become_user: '{{ gitea_user }}'
|
become_user: '{{ gitea_user }}'
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: header.tmpl
|
src: header.tmpl
|
||||||
dest: '{{ gitea_data_dir }}/custom/templates/custom/header.tmpl'
|
dest: '{{ gitea_data_dir }}/custom/templates/custom/header.tmpl'
|
||||||
mode: 0444
|
mode: "0444"
|
||||||
|
|
||||||
- name: Check if the awesome fonts are installed
|
- name: renderers | Check if the awesome fonts are installed
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: /usr/share/fonts-font-awesome
|
path: /usr/share/fonts-font-awesome
|
||||||
register: awesome_fonts_dir
|
register: awesome_fonts_dir
|
||||||
|
|
||||||
- name: Link to the awesome fonts directory
|
- name: renderers | Link to the awesome fonts directory
|
||||||
become: true
|
become: true
|
||||||
become_user: '{{ gitea_user }}'
|
become_user: '{{ gitea_user }}'
|
||||||
file:
|
ansible.builtin.file:
|
||||||
src: /usr/share/fonts-font-awesome
|
src: /usr/share/fonts-font-awesome
|
||||||
dest: '{{ gitea_data_dir }}/custom/public/components/font-awesome'
|
dest: '{{ gitea_data_dir }}/custom/public/assets/components/font-awesome'
|
||||||
state: link
|
state: link
|
||||||
when: awesome_fonts_dir.stat.exists
|
when: awesome_fonts_dir.stat.exists
|
||||||
|
|
||||||
tags: [ 'git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_jupyter' ]
|
- name: renderers | Configure restructuredtext markup
|
||||||
|
tags: ['git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_restructuredtext']
|
||||||
- name: Configure restructuredtext markup
|
|
||||||
block:
|
block:
|
||||||
- name: Configure restructuredtext markup
|
- name: renderers | Configure restructuredtext markup
|
||||||
ini_file:
|
community.general.ini_file:
|
||||||
path: '{{ gitea_conf_dir }}/app.ini'
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
section: '{{ item.section }}'
|
section: '{{ item.section }}'
|
||||||
option: '{{ item.option }}'
|
option: '{{ item.option }}'
|
||||||
|
@ -98,17 +96,16 @@
|
||||||
owner: '{{ gitea_user }}'
|
owner: '{{ gitea_user }}'
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
create: no
|
create: false
|
||||||
loop: '{{ gitea_markup_restructuredtext_conf }}'
|
loop: '{{ gitea_markup_restructuredtext_conf }}'
|
||||||
when: gitea_install_viewer_addons
|
when: gitea_install_viewer_addons
|
||||||
notify: restart gitea
|
notify: Restart gitea
|
||||||
|
|
||||||
tags: [ 'git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_restructuredtext' ]
|
- name: renderers | Configure sanitizer TeX markup
|
||||||
|
tags: ['git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_sanitizer_tex']
|
||||||
- name: Configure sanitizer TeX markup
|
|
||||||
block:
|
block:
|
||||||
- name: Configure sanitizer TeX markup
|
- name: renderers | Configure sanitizer TeX markup
|
||||||
ini_file:
|
community.general.ini_file:
|
||||||
path: '{{ gitea_conf_dir }}/app.ini'
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
section: '{{ item.section }}'
|
section: '{{ item.section }}'
|
||||||
option: '{{ item.option }}'
|
option: '{{ item.option }}'
|
||||||
|
@ -117,17 +114,16 @@
|
||||||
owner: '{{ gitea_user }}'
|
owner: '{{ gitea_user }}'
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
create: no
|
create: false
|
||||||
loop: '{{ gitea_markup_sanitizer_tex_conf }}'
|
loop: '{{ gitea_markup_sanitizer_tex_conf }}'
|
||||||
when: gitea_install_viewer_addons
|
when: gitea_install_viewer_addons
|
||||||
notify: restart gitea
|
notify: Restart gitea
|
||||||
|
|
||||||
tags: [ 'git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_sanitizer_tex' ]
|
- name: renderers | Configure markdown markup
|
||||||
|
tags: ['git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_markdown']
|
||||||
- name: Configure markdown markup
|
|
||||||
block:
|
block:
|
||||||
- name: Configure markdown markup
|
- name: renderers | Configure markdown markup
|
||||||
ini_file:
|
community.general.ini_file:
|
||||||
path: '{{ gitea_conf_dir }}/app.ini'
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
section: '{{ item.section }}'
|
section: '{{ item.section }}'
|
||||||
option: '{{ item.option }}'
|
option: '{{ item.option }}'
|
||||||
|
@ -136,17 +132,17 @@
|
||||||
owner: '{{ gitea_user }}'
|
owner: '{{ gitea_user }}'
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
create: no
|
create: false
|
||||||
loop: '{{ gitea_markup_markdown_conf }}'
|
loop: '{{ gitea_markup_markdown_conf }}'
|
||||||
when: gitea_install_viewer_addons
|
when: gitea_install_viewer_addons
|
||||||
notify: restart gitea
|
notify: Restart gitea
|
||||||
|
|
||||||
tags: [ 'git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_markdown' ]
|
- name: renderers | Configure docx markup
|
||||||
|
when: gitea_install_viewer_addons
|
||||||
- name: Configure docx markup
|
tags: ['git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_docx']
|
||||||
block:
|
block:
|
||||||
- name: Configure the docx markup
|
- name: renderers | Configure the docx markup
|
||||||
ini_file:
|
community.general.ini_file:
|
||||||
path: '{{ gitea_conf_dir }}/app.ini'
|
path: '{{ gitea_conf_dir }}/app.ini'
|
||||||
section: '{{ item.section }}'
|
section: '{{ item.section }}'
|
||||||
option: '{{ item.option }}'
|
option: '{{ item.option }}'
|
||||||
|
@ -155,17 +151,14 @@
|
||||||
owner: '{{ gitea_user }}'
|
owner: '{{ gitea_user }}'
|
||||||
group: '{{ gitea_group }}'
|
group: '{{ gitea_group }}'
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
create: no
|
create: false
|
||||||
loop: '{{ gitea_markup_docx_conf }}'
|
loop: '{{ gitea_markup_docx_conf }}'
|
||||||
notify: restart gitea
|
notify: Restart gitea
|
||||||
|
|
||||||
- name: Create the docx template
|
- name: renderers | Create the docx template
|
||||||
become: true
|
become: true
|
||||||
become_user: '{{ gitea_user }}'
|
become_user: '{{ gitea_user }}'
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
content: "$body$"
|
content: "$body$"
|
||||||
dest: '{{ gitea_data_dir }}/custom/templates/docx-basic.html'
|
dest: '{{ gitea_data_dir }}/custom/templates/docx-basic.html'
|
||||||
|
mode: "0644"
|
||||||
when: gitea_install_viewer_addons
|
|
||||||
tags: [ 'git', 'gitea', 'gitea_addons', 'gitea_conf', 'gitea_docx' ]
|
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,6 @@ MAX_CREATION_LIMIT = {{ gitea_max_repository_per_user }}
|
||||||
PROTOCOL = {{ gitea_server_protocol }}
|
PROTOCOL = {{ gitea_server_protocol }}
|
||||||
HTTP_ADDR = {{ gitea_http_addr }}
|
HTTP_ADDR = {{ gitea_http_addr }}
|
||||||
LANDING_PAGE = {{ gitea_landing_page }}
|
LANDING_PAGE = {{ gitea_landing_page }}
|
||||||
LFS_START_SERVER = {{ gitea_start_lfs }}
|
|
||||||
LFS_CONTENT_PATH = {{ gitea_lfs_content_path }}
|
|
||||||
LFS_HTTP_AUTH_EXPIRY = {{ gitea_lfs_http_auth_expiry }}
|
|
||||||
SSH_DOMAIN = {{ gitea_hostname }}
|
SSH_DOMAIN = {{ gitea_hostname }}
|
||||||
DOMAIN = {{ gitea_hostname }}
|
DOMAIN = {{ gitea_hostname }}
|
||||||
HTTP_PORT = {{ gitea_http_port }}
|
HTTP_PORT = {{ gitea_http_port }}
|
||||||
|
|
|
@ -22,9 +22,8 @@ Requires=memcached.service
|
||||||
# of that
|
# of that
|
||||||
###
|
###
|
||||||
#LimitMEMLOCK=infinity
|
#LimitMEMLOCK=infinity
|
||||||
#LimitNOFILE=65535
|
LimitNOFILE={{ gitea_limit_nofile }}
|
||||||
LimitNOFILE=8192
|
LimitNOFILESoft={{ gitea_limit_nofile_soft }}
|
||||||
LimitNOFILESoft=1024
|
|
||||||
RestartSec=2s
|
RestartSec=2s
|
||||||
Type=simple
|
Type=simple
|
||||||
User={{ gitea_user }}
|
User={{ gitea_user }}
|
||||||
|
|
Loading…
Reference in New Issue