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

Commit df8a4d2

Browse files
authored
Merge pull request #177 from alexanderfast/fixletsencrypt
Fix quoting in letsencrypt
2 parents 344f9c0 + e790de9 commit df8a4d2

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,31 @@ The `gitlab.rb.j2` template packaged with this role is meant to be very generic
4848

4949
### SSL Configuration.
5050

51-
gitlab_redirect_http_to_https: "true"
51+
gitlab_redirect_http_to_https: true
5252
gitlab_ssl_certificate: "/etc/gitlab/ssl/{{ gitlab_domain }}.crt"
5353
gitlab_ssl_certificate_key: "/etc/gitlab/ssl/{{ gitlab_domain }}.key"
5454

5555
GitLab SSL configuration; tells GitLab to redirect normal http requests to https, and the path to the certificate and key (the default values will work for automatic self-signed certificate creation, if set to `true` in the variable below).
5656

5757
# SSL Self-signed Certificate Configuration.
58-
gitlab_create_self_signed_cert: "true"
58+
gitlab_create_self_signed_cert: true
5959
gitlab_self_signed_cert_subj: "/C=US/ST=Missouri/L=Saint Louis/O=IT/CN={{ gitlab_domain }}"
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

6363
### LetsEncrypt Configuration.
6464

65-
gitlab_letsencrypt_enable: "false"
65+
gitlab_letsencrypt_enable: false
6666
gitlab_letsencrypt_contact_emails: ["[email protected]"]
6767
gitlab_letsencrypt_auto_renew_hour: 1
6868
gitlab_letsencrypt_auto_renew_minute: 30
6969
gitlab_letsencrypt_auto_renew_day_of_month: "*/7"
7070
gitlab_letsencrypt_auto_renew: true
7171

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.
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.
7373

7474
# LDAP Configuration.
75-
gitlab_ldap_enabled: "false"
75+
gitlab_ldap_enabled: false
7676
gitlab_ldap_host: "example.com"
7777
gitlab_ldap_port: "389"
7878
gitlab_ldap_uid: "sAMAccountName"
@@ -105,23 +105,23 @@ How long to keep local backups (useful if you don't want backups to fill up your
105105
Controls whether to validate certificates when downloading the GitLab installation repository install script.
106106

107107
# Email configuration.
108-
gitlab_email_enabled: "false"
108+
gitlab_email_enabled: false
109109
gitlab_email_from: "[email protected]"
110110
gitlab_email_display_name: "Gitlab"
111111
gitlab_email_reply_to: "[email protected]"
112112

113113
Gitlab system mail configuration. Disabled by default; set `gitlab_email_enabled` to `true` to enable, and make sure you enter valid from/reply-to values.
114114

115115
# SMTP Configuration
116-
gitlab_smtp_enable: "false"
116+
gitlab_smtp_enable: false
117117
gitlab_smtp_address: "smtp.server"
118118
gitlab_smtp_port: "465"
119119
gitlab_smtp_user_name: "smtp user"
120120
gitlab_smtp_password: "smtp password"
121121
gitlab_smtp_domain: "example.com"
122122
gitlab_smtp_authentication: "login"
123-
gitlab_smtp_enable_starttls_auto: "true"
124-
gitlab_smtp_tls: "false"
123+
gitlab_smtp_enable_starttls_auto: true
124+
gitlab_smtp_tls: false
125125
gitlab_smtp_openssl_verify_mode: "none"
126126
gitlab_smtp_ca_path: "/etc/ssl/certs"
127127
gitlab_smtp_ca_file: "/etc/ssl/certs/ca-certificates.crt"
@@ -132,7 +132,7 @@ Gitlab SMTP configuration; of `gitlab_smtp_enable` is `true`, the rest of the co
132132

133133
If you are running GitLab behind a reverse proxy, you may want to override the listen port to something else.
134134

135-
gitlab_nginx_listen_https: "false"
135+
gitlab_nginx_listen_https: false
136136

137137
If you are running GitLab behind a reverse proxy, you may wish to terminate SSL at another proxy server or load balancer
138138

defaults/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ gitlab_backup_path: "/var/opt/gitlab/backups"
99
gitlab_config_template: "gitlab.rb.j2"
1010

1111
# SSL Configuration.
12-
gitlab_redirect_http_to_https: "true"
12+
gitlab_redirect_http_to_https: true
1313
gitlab_ssl_certificate: "/etc/gitlab/ssl/{{ gitlab_domain }}.crt"
1414
gitlab_ssl_certificate_key: "/etc/gitlab/ssl/{{ gitlab_domain }}.key"
1515

1616
# SSL Self-signed Certificate Configuration.
17-
gitlab_create_self_signed_cert: "true"
17+
gitlab_create_self_signed_cert: true
1818
gitlab_self_signed_cert_subj: "/C=US/ST=Missouri/L=Saint Louis/O=IT/CN={{ gitlab_domain }}"
1919

2020
# LDAP Configuration.
21-
gitlab_ldap_enabled: "false"
21+
gitlab_ldap_enabled: false
2222
gitlab_ldap_host: "example.com"
2323
gitlab_ldap_port: "389"
2424
gitlab_ldap_uid: "sAMAccountName"
@@ -28,15 +28,15 @@ gitlab_ldap_password: "password"
2828
gitlab_ldap_base: "DC=example,DC=com"
2929

3030
# SMTP Configuration
31-
gitlab_smtp_enable: "false"
31+
gitlab_smtp_enable: false
3232
gitlab_smtp_address: "smtp.server"
3333
gitlab_smtp_port: "465"
3434
gitlab_smtp_user_name: "smtp user"
3535
gitlab_smtp_password: "smtp password"
3636
gitlab_smtp_domain: "example.com"
3737
gitlab_smtp_authentication: "login"
38-
gitlab_smtp_enable_starttls_auto: "true"
39-
gitlab_smtp_tls: "false"
38+
gitlab_smtp_enable_starttls_auto: true
39+
gitlab_smtp_tls: false
4040
gitlab_smtp_openssl_verify_mode: "none"
4141
gitlab_smtp_ca_path: "/etc/ssl/certs"
4242
gitlab_smtp_ca_file: "/etc/ssl/certs/ca-certificates.crt"
@@ -63,19 +63,19 @@ gitlab_download_validate_certs: true
6363
gitlab_default_theme: '2'
6464

6565
# Email configuration.
66-
gitlab_email_enabled: "false"
66+
gitlab_email_enabled: false
6767
gitlab_email_from: "[email protected]"
6868
gitlab_email_display_name: "Gitlab"
6969
gitlab_email_reply_to: "[email protected]"
7070

7171
# Registry configuration.
72-
gitlab_registry_enable: "false"
72+
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"
7676

7777
# LetsEncrypt configuration.
78-
gitlab_letsencrypt_enable: "false"
78+
gitlab_letsencrypt_enable: false
7979
gitlab_letsencrypt_contact_emails: ["[email protected]"]
8080
gitlab_letsencrypt_auto_renew_hour: 1
8181
gitlab_letsencrypt_auto_renew_minute: 30

templates/gitlab.rb.j2

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ external_url "{{ gitlab_external_url }}"
44
# gitlab.yml configuration
55
gitlab_rails['time_zone'] = "{{ gitlab_time_zone }}"
66
gitlab_rails['backup_keep_time'] = {{ gitlab_backup_keep_time }}
7-
gitlab_rails['gitlab_email_enabled'] = {{ gitlab_email_enabled }}
8-
{% if gitlab_email_enabled == "true" %}
7+
gitlab_rails['gitlab_email_enabled'] = {{ gitlab_email_enabled | lower }}
8+
{% if gitlab_email_enabled %}
99
gitlab_rails['gitlab_email_from'] = "{{ gitlab_email_from }}"
1010
gitlab_rails['gitlab_email_display_name'] = "{{ gitlab_email_display_name }}"
1111
gitlab_rails['gitlab_email_reply_to'] = "{{ gitlab_email_reply_to }}"
@@ -15,17 +15,17 @@ gitlab_rails['gitlab_email_reply_to'] = "{{ gitlab_email_reply_to }}"
1515
gitlab_rails['gitlab_default_theme'] = "{{ gitlab_default_theme }}"
1616

1717
# Whether to redirect http to https.
18-
nginx['redirect_http_to_https'] = {{ gitlab_redirect_http_to_https }}
18+
nginx['redirect_http_to_https'] = {{ gitlab_redirect_http_to_https | lower }}
1919
nginx['ssl_certificate'] = "{{ gitlab_ssl_certificate }}"
2020
nginx['ssl_certificate_key'] = "{{ gitlab_ssl_certificate_key }}"
2121

22-
letsencrypt['enable'] = "{{ gitlab_letsencrypt_enable }}"
22+
letsencrypt['enable'] = {{ gitlab_letsencrypt_enable | lower }}
2323
{% if gitlab_letsencrypt_enable %}
24-
letsencrypt['contact_emails'] = "{{ gitlab_letsencrypt_contact_emails | to_json }}"
24+
letsencrypt['contact_emails'] = {{ gitlab_letsencrypt_contact_emails | to_json }}
2525
letsencrypt['auto_renew_hour'] = "{{ gitlab_letsencrypt_auto_renew_hour }}"
2626
letsencrypt['auto_renew_minute'] = "{{ gitlab_letsencrypt_auto_renew_minute }}"
2727
letsencrypt['auto_renew_day_of_month'] = "{{ gitlab_letsencrypt_auto_renew_day_of_month }}"
28-
letsencrypt['auto_renew'] = "{{ gitlab_letsencrypt_auto_renew }}"
28+
letsencrypt['auto_renew'] = {{ gitlab_letsencrypt_auto_renew | lower }}
2929
{% endif %}
3030

3131
# The directory where Git repositories will be stored.
@@ -36,8 +36,8 @@ gitlab_rails['backup_path'] = "{{ gitlab_backup_path }}"
3636

3737
# These settings are documented in more detail at
3838
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example#L118
39-
gitlab_rails['ldap_enabled'] = {{ gitlab_ldap_enabled }}
40-
{% if gitlab_ldap_enabled == "true" %}
39+
gitlab_rails['ldap_enabled'] = {{ gitlab_ldap_enabled | lower }}
40+
{% if gitlab_ldap_enabled %}
4141
gitlab_rails['ldap_host'] = '{{ gitlab_ldap_host }}'
4242
gitlab_rails['ldap_port'] = {{ gitlab_ldap_port }}
4343
gitlab_rails['ldap_uid'] = '{{ gitlab_ldap_uid }}'
@@ -54,14 +54,14 @@ gitlab_rails['ldap_base'] = '{{ gitlab_ldap_base }}'
5454
nginx['listen_port'] = "{{ gitlab_nginx_listen_port }}"
5555
{% endif %}
5656
{% if gitlab_nginx_listen_https is defined %}
57-
nginx['listen_https'] = {{ gitlab_nginx_listen_https }}
57+
nginx['listen_https'] = {{ gitlab_nginx_listen_https | lower }}
5858
{% endif %}
5959

6060
# Use smtp instead of sendmail/postfix
6161
# More details and example configuration at
6262
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/smtp.md
63-
gitlab_rails['smtp_enable'] = {{ gitlab_smtp_enable }}
64-
{% if gitlab_smtp_enable == "true" %}
63+
gitlab_rails['smtp_enable'] = {{ gitlab_smtp_enable | lower }}
64+
{% if gitlab_smtp_enable %}
6565
gitlab_rails['smtp_address'] = '{{ gitlab_smtp_address }}'
6666
gitlab_rails['smtp_port'] = {{ gitlab_smtp_port }}
6767
{% if gitlab_smtp_user_name %}
@@ -74,8 +74,8 @@ gitlab_rails['smtp_domain'] = '{{ gitlab_smtp_domain }}'
7474
{% if gitlab_smtp_authentication %}
7575
gitlab_rails['smtp_authentication'] = '{{ gitlab_smtp_authentication }}'
7676
{% endif %}
77-
gitlab_rails['smtp_enable_starttls_auto'] = {{ gitlab_smtp_enable_starttls_auto }}
78-
gitlab_rails['smtp_tls'] = {{ gitlab_smtp_tls }}
77+
gitlab_rails['smtp_enable_starttls_auto'] = {{ gitlab_smtp_enable_starttls_auto | lower }}
78+
gitlab_rails['smtp_tls'] = {{ gitlab_smtp_tls | lower }}
7979
gitlab_rails['smtp_openssl_verify_mode'] = '{{ gitlab_smtp_openssl_verify_mode }}'
8080
gitlab_rails['smtp_ca_path'] = '{{ gitlab_smtp_ca_path }}'
8181
gitlab_rails['smtp_ca_file'] = '{{ gitlab_smtp_ca_file }}'
@@ -90,8 +90,8 @@ nginx['ssl_client_certificate'] = "{{ gitlab_nginx_ssl_client_certificate }}"
9090
{% endif %}
9191

9292
# GitLab registry.
93-
registry['enable'] = {{ gitlab_registry_enable }}
94-
{% if gitlab_registry_enable == "true" %}
93+
registry['enable'] = {{ gitlab_registry_enable | lower }}
94+
{% if gitlab_registry_enable %}
9595
registry_external_url "{{ gitlab_registry_external_url }}"
9696
registry_nginx['ssl_certificate'] = "{{ gitlab_registry_nginx_ssl_certificate }}"
9797
registry_nginx['ssl_certificate_key'] = "{{ gitlab_registry_nginx_ssl_certificate_key }}"

0 commit comments

Comments
 (0)