Skip to content

Commit

Permalink
Add SSL support for gitlab
Browse files Browse the repository at this point in the history
  • Loading branch information
neuhalje committed Mar 11, 2017
1 parent a537bcb commit 07ab00b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gitlab/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ gitlab:
pidfile: /var/run/gitsshd.pid
user: git
port: 22448
pki:
certificate_file: /etc/gitlab/ssl.crt
key_file: /etc/gitlab/ssl.key
1 change: 1 addition & 0 deletions gitlab/files/file_template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ content }}
20 changes: 20 additions & 0 deletions gitlab/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ mattermost-url:
- pkg: gitlab
{% endif %}
{% if 'pki' in gitlab %}
gitlab-ssl-cert:
file.managed:
- name: {{ gitlab.pki.certificate_file }}
- mode: 600
- source: salt://gitlab/files/file_template
- template: jinja
- context:
content: {{ gitlab.pki.certificate|yaml_encode }}
gitlab-ssl-key:
file.managed:
- name: {{ gitlab.pki.key_file }}
- mode: 600
- source: salt://gitlab/files/file_template
- template: jinja
- context:
content: {{ gitlab.pki.key|yaml_encode }}
{% endif %}
gitlab-config:
file.blockreplace:
- name: {{ gitlab.config_file }}
Expand Down
10 changes: 10 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ gitlab:
"app_secret" => "example_app_secret",
"args" => { "access_type" => "offline", "approval_prompt" => "" }
}]
pki:
certificate: |
-----BEGIN CERTIFICATE-----
..
-----END CERTIFICATE-----
key: |
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----

0 comments on commit 07ab00b

Please sign in to comment.