File tree Expand file tree Collapse file tree 6 files changed +36
-1
lines changed
gitlab-cookbooks/gitlab-kas
spec/chef/cookbooks/gitlab-kas/recipes Expand file tree Collapse file tree 6 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -2112,6 +2112,11 @@ external_url 'GENERATED_EXTERNAL_URL'
2112
2112
# gitlab_kas['redis_sentinels_master_name'] = nil
2113
2113
# gitlab_kas['redis_sentinels_password'] = ''
2114
2114
2115
+ # gitlab_kas['redis_ssl'] = false
2116
+ # gitlab_kas['redis_tls_ca_cert_file'] = '/opt/gitlab/embedded/ssl/certs/cacert.pem'
2117
+ # gitlab_kas['redis_tls_client_cert_file'] = nil
2118
+ # gitlab_kas['redis_tls_client_key_file'] = nil
2119
+
2115
2120
################################################################################
2116
2121
## GitLab Suggested Reviewers (EE Only)
2117
2122
##! Docs: https://docs.gitlab.com/ee/user/project/merge_requests/reviews/#suggested-reviewers
Original file line number Diff line number Diff line change 54
54
default [ 'gitlab_kas' ] [ 'redis_sentinels' ] = nil
55
55
default [ 'gitlab_kas' ] [ 'redis_sentinels_master_name' ] = nil
56
56
default [ 'gitlab_kas' ] [ 'redis_sentinels_password' ] = nil
57
+ default [ 'gitlab_kas' ] [ 'redis_ssl' ] = nil
58
+ default [ 'gitlab_kas' ] [ 'redis_tls_ca_cert_file' ] = nil
59
+ default [ 'gitlab_kas' ] [ 'redis_tls_client_cert_file' ] = nil
60
+ default [ 'gitlab_kas' ] [ 'redis_tls_client_key_file' ] = nil
Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ def parse_redis_settings
114
114
redis_password
115
115
redis_sentinels
116
116
redis_sentinels_password
117
+ redis_ssl
118
+ redis_tls_ca_cert_file
119
+ redis_tls_client_cert_file
120
+ redis_tls_client_key_file
117
121
]
118
122
settings_copied_from_gitlab_rails . each do |setting |
119
123
Gitlab [ 'gitlab_kas' ] [ setting ] = Gitlab [ 'gitlab_rails' ] [ setting ] || Gitlab [ 'node' ] [ 'gitlab' ] [ 'gitlab_rails' ] [ setting ] unless Gitlab [ 'gitlab_kas' ] . key? ( setting )
Original file line number Diff line number Diff line change 37
37
gitlab_kas_redis_sentinels_password_file = File . join ( working_dir , 'redis_sentinels_password_file' )
38
38
redis_default_port = URI ::Redis ::DEFAULT_PORT
39
39
redis_network = redis_helper . redis_url . scheme == 'unix' ? 'unix' : 'tcp'
40
- redis_ssl = node [ 'gitlab' ] [ 'gitlab_rails '] [ 'redis_ssl' ]
40
+ redis_ssl = node [ 'gitlab_kas ' ] [ 'redis_ssl' ]
41
41
redis_address = if redis_network == 'tcp'
42
42
"#{ redis_host } :#{ redis_port || redis_default_port } "
43
43
else
44
44
node [ 'gitlab_kas' ] [ 'redis_socket' ]
45
45
end
46
+ redis_tls_ca_cert_file = node [ 'gitlab_kas' ] [ 'redis_tls_ca_cert_file' ]
47
+ redis_tls_client_cert_file = node [ 'gitlab_kas' ] [ 'redis_tls_client_cert_file' ]
48
+ redis_tls_client_key_file = node [ 'gitlab_kas' ] [ 'redis_tls_client_key_file' ]
46
49
47
50
[
48
51
working_dir ,
119
122
redis_network : redis_network ,
120
123
redis_address : redis_address ,
121
124
redis_ssl : redis_ssl ,
125
+ redis_tls_ca_cert_file : redis_tls_ca_cert_file ,
126
+ redis_tls_client_cert_file : redis_tls_client_cert_file ,
127
+ redis_tls_client_key_file : redis_tls_client_key_file ,
122
128
redis_default_port : redis_default_port ,
123
129
redis_password_file : redis_password_present ? gitlab_kas_redis_password_file : nil ,
124
130
redis_sentinels_master_name : redis_sentinels_master_name ,
Original file line number Diff line number Diff line change @@ -45,6 +45,17 @@ redis:
45
45
network: <%= @redis_network %>
46
46
tls:
47
47
enabled: <%= @redis_ssl %>
48
+ <%- if @redis_ssl %>
49
+ <%- if @redis_tls_ca_cert_file %>
50
+ ca_certificate_file: "<%= @redis_tls_ca_cert_file %> "
51
+ <% end %>
52
+ <%- if @redis_tls_client_cert_file %>
53
+ certificate_file: "<%= @redis_tls_client_cert_file %> "
54
+ <% end %>
55
+ <%- if @redis_tls_client_key_file %>
56
+ key_file: "<%= @redis_tls_client_key_file %> "
57
+ <% end %>
58
+ <% end %>
48
59
<%- if @redis_password_file %>
49
60
password_file: <%= @redis_password_file %>
50
61
<%- end %>
Original file line number Diff line number Diff line change 445
445
redis_host : 'the-host' ,
446
446
redis_port : 12345 ,
447
447
redis_ssl : true ,
448
+ redis_tls_client_cert_file : '/etc/gitlab/self_signed.crt' ,
449
+ redis_tls_client_key_file : '/etc/gitlab/self_signed.key'
448
450
}
449
451
)
450
452
end
457
459
'network' => 'tcp' ,
458
460
'tls' => {
459
461
'enabled' => true ,
462
+ 'ca_certificate_file' => '/opt/gitlab/embedded/ssl/certs/cacert.pem' ,
463
+ 'certificate_file' => '/etc/gitlab/self_signed.crt' ,
464
+ 'key_file' => '/etc/gitlab/self_signed.key' ,
460
465
} ,
461
466
'server' => {
462
467
'address' => 'the-host:12345'
You can’t perform that action at this time.
0 commit comments