Compare commits

..

1 Commits

3 changed files with 20 additions and 2 deletions

View File

@ -20,7 +20,7 @@ gitea_container_extra_volumes: []
# container defaults
gitea_container_base_volumes:
- "{{ gitea_data_paths }}:/data:z"
- "{{ gitea_data_path }}:/data:z"
- "/home/{{ gitea_user }}/.ssh/:/data/git/.ssh:z"
gitea_container_base_ports:
@ -33,3 +33,5 @@ gitea_container_base_env:
gitea_container_base_labels:
version: "{{ gitea_version }}"
gitea_config: {}

View File

@ -81,3 +81,19 @@
published_ports: "{{ gitea_container_ports }}"
restart_policy: "{{ gitea_container_restart_policy }}"
state: started
- name: Ensure given configuration is set in the config file
ini_file:
path: "{{ gitea_data_path }}/gitea/conf/app.ini"
section: "{{ section }}"
option: "{{ option }}"
value: "{{ entry.value }}"
state: "{{ 'present' if (entry.value is string or entry.value is sequence or entry.value is boolean or entry.value is number) else 'absent' }}"
loop: "{{ lookup('ansible.utils.to_paths', gitea_config) | dict2items }}"
loop_control:
loop_var: entry
label: "{{ section | default('/', True) }}->{{ option }}"
vars:
key_split: "{{ entry.key | split('.') }}"
section: "{{ '' if key_split|length == 1 else (key_split | first) }}"
option: "{{ key_split | first if key_split|length == 1 else key_split[1:] | join('.') }}"

View File

@ -6,7 +6,7 @@ gitea_container_labels: "{{ gitea_container_base_labels | combine(gitea_containe
gitea_container_env: "{{ gitea_container_base_env | combine(gitea_container_extra_env) }}"
gitea_container_ports: "{{ gitea_container_base_ports | combine(gitea_container_extra_ports }}"
gitea_container_ports: "{{ gitea_container_base_ports + gitea_container_extra_ports }}"
gitea_container_port_webui: 3000