From 503235ecd34378c60b0a4613a7888e3742de13a0 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Wed, 23 Dec 2020 17:02:40 -0700 Subject: [PATCH] gitlab ssl changes --- ansible/playbooks/role-gitlab-ee.yml | 4 ++++ .../playbooks/templates/etc/nginx/conf.d/omnibus.conf.j2 | 6 +++--- ansible/playbooks/vars/gitlab.yml | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ansible/playbooks/role-gitlab-ee.yml b/ansible/playbooks/role-gitlab-ee.yml index ff50ab9..e52b63c 100644 --- a/ansible/playbooks/role-gitlab-ee.yml +++ b/ansible/playbooks/role-gitlab-ee.yml @@ -28,6 +28,10 @@ state: present roles: + - role: geerlingguy.certbot + state: present + when: not gitlab_create_self_signed_cert + - role: geerlingguy.gitlab state: present diff --git a/ansible/playbooks/templates/etc/nginx/conf.d/omnibus.conf.j2 b/ansible/playbooks/templates/etc/nginx/conf.d/omnibus.conf.j2 index 9bf023c..a9fbea8 100644 --- a/ansible/playbooks/templates/etc/nginx/conf.d/omnibus.conf.j2 +++ b/ansible/playbooks/templates/etc/nginx/conf.d/omnibus.conf.j2 @@ -31,12 +31,12 @@ server { ## Strong SSL Security ## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html & https://cipherli.st/ ssl on; - ssl_certificate /etc/nginx/ssl/gitlab.crt; - ssl_certificate_key /etc/nginx/ssl/gitlab.key; + ssl_certificate {{ gitlab_ssl_cert }}; + ssl_certificate_key {{ gitlab_ssl_key }}; # GitLab needs backwards compatible ciphers to retain compatibility with Java IDEs ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_protocols TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 5m; diff --git a/ansible/playbooks/vars/gitlab.yml b/ansible/playbooks/vars/gitlab.yml index e489443..bfa66de 100644 --- a/ansible/playbooks/vars/gitlab.yml +++ b/ansible/playbooks/vars/gitlab.yml @@ -16,6 +16,8 @@ gitlab_create_self_signed_cert: "true" gitlab_self_signed_cert_subj: "/C=US/ST=Missouri/L=Saint Louis/O=IT/CN={{ gitlab_domain }}" gitlab_ssl_certificate: "/etc/gitlab/ssl/{{ gitlab_domain }}.crt" gitlab_ssl_certificate_key: "/etc/gitlab/ssl/{{ gitlab_domain }}.key" +gitlab_ssl_cert: "/etc/nginx/ssl/{{ gitlab_domain }}.crt" +gitlab_ssl_key: "/etc/nginx/ssl/{{ gitlab_domain }}.key" # LDAP Configuration gitlab_ldap_enabled: "true"