Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit edde725

Browse files
authored
Merge pull request #134 from williampiv/master
Add Variables to Allow GitLab to use LetsEncrypt
2 parents 2b7f034 + 7addb72 commit edde725

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ GitLab SSL configuration; tells GitLab to redirect normal http requests to https
6060

6161
Whether to create a self-signed certificate for serving GitLab over a secure connection. Set `gitlab_self_signed_cert_subj` according to your locality and organization.
6262

63+
### LetsEncrypt Configuration.
64+
65+
gitlab_letsencrypt_enable: "false"
66+
gitlab_letsencrypt_contact_emails: ["[email protected]"]
67+
gitlab_letsencrypt_auto_renew_hour: 1
68+
gitlab_letsencrypt_auto_renew_minute: 30
69+
gitlab_letsencrypt_auto_renew_day_of_month: "*/7"
70+
gitlab_letsencrypt_auto_renew: true
71+
72+
GitLab LetsEncrypt configuration; tells GitLab whether to request and use a certificate from LetsEncrypt, if `gitlab_letsencrypt_enable` is set to `"true"`. Multiple contact emails can be configured under `gitlab_letsencrypt_contact_emails` as a list.
73+
6374
# LDAP Configuration.
6475
gitlab_ldap_enabled: "false"
6576
gitlab_ldap_host: "example.com"

defaults/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,11 @@ gitlab_registry_enable: "false"
7373
gitlab_registry_external_url: "https://gitlab.example.com:4567"
7474
gitlab_registry_nginx_ssl_certificate: "/etc/gitlab/ssl/gitlab.crt"
7575
gitlab_registry_nginx_ssl_certificate_key: "/etc/gitlab/ssl/gitlab.key"
76+
77+
# LetsEncrypt configuration.
78+
gitlab_letsencrypt_enable: "false"
79+
gitlab_letsencrypt_contact_emails: ["[email protected]"]
80+
gitlab_letsencrypt_auto_renew_hour: 1
81+
gitlab_letsencrypt_auto_renew_minute: 30
82+
gitlab_letsencrypt_auto_renew_day_of_month: "*/7"
83+
gitlab_letsencrypt_auto_renew: true

templates/gitlab.rb.j2

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ nginx['redirect_http_to_https'] = {{ gitlab_redirect_http_to_https }}
1919
nginx['ssl_certificate'] = "{{ gitlab_ssl_certificate }}"
2020
nginx['ssl_certificate_key'] = "{{ gitlab_ssl_certificate_key }}"
2121

22+
letsencrypt['enable'] = "{{ gitlab_letsencrypt_enable }}"
23+
{% if gitlab_letsencrypt_enable %}
24+
letsencrypt['contact_emails'] = "{{ gitlab_letsencrypt_contact_emails | to_json }}"
25+
letsencrypt['auto_renew_hour'] = "{{ gitlab_letsencrypt_auto_renew_hour }}"
26+
letsencrypt['auto_renew_minute'] = "{{ gitlab_letsencrypt_auto_renew_minute }}"
27+
letsencrypt['auto_renew_day_of_month'] = "{{ gitlab_letsencrypt_auto_renew_day_of_month }}"
28+
letsencrypt['auto_renew'] = "{{ gitlab_letsencrypt_auto_renew }}"
29+
{% endif %}
30+
2231
# The directory where Git repositories will be stored.
2332
git_data_dirs({"default" => {"path" => "{{ gitlab_git_data_dir }}"} })
2433

0 commit comments

Comments
 (0)