diff --git a/roles/gitlab/defaults/main.yml b/roles/gitlab/defaults/main.yml index c4fcecf..ad117a6 100644 --- a/roles/gitlab/defaults/main.yml +++ b/roles/gitlab/defaults/main.yml @@ -24,6 +24,9 @@ gitlab_data_location: "{{ gitlab_install_location }}/data" gitlab_config_location: "{{ gitlab_install_location }}/config" gitlab_log_location: "{{ gitlab_install_location }}/log" +# Put GitLab's logs in a tempfs instead to save headache with diskspace +gitlab_log_tmpfs: false + # Set the certresolver to your desired traefik certresolver. # Note: This is `letsencrypt_cf` by default for backwards compatibility, you might want to use `letsencrypt_http` instead, depending on your setup gitlab_traefik_certresolver: letsencrypt_http diff --git a/roles/gitlab/templates/docker-compose.yml b/roles/gitlab/templates/docker-compose.yml index cb77a14..e61988b 100644 --- a/roles/gitlab/templates/docker-compose.yml +++ b/roles/gitlab/templates/docker-compose.yml @@ -203,7 +203,16 @@ services: volumes: - "{{ gitlab_data_location }}:/var/opt/gitlab" - "{{ gitlab_config_location }}:/etc/gitlab" +{% if gitlab_log_tmpfs %} - "{{ gitlab_log_location }}:/var/log/gitlab" +{% endif %} + + +{% if gitlab_log_tmpfs %} + tmpfs: + - "/var/log/gitlab:size=1G,noexec,nodev,nosuid,rw" +{% endif %} + restart: always ports: - "{{ gitlab_ssh_port }}:22"