Skip to content

Commit

Permalink
Merge pull request #261 from martonivan/master
Browse files Browse the repository at this point in the history
Add mutual TLS (mTLS/client side TLS) options to the configuration
  • Loading branch information
riemers authored Jun 20, 2023
2 parents 968034c + 4cf5ed7 commit 51ba7ff
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ gitlab_runner_runners:
# docker_wait_for_services_timeout: 30
# Custom CA certificate file
# tls_ca_file: "/etc/ssl/private/Custom_Bundle-CA.pem"
# Client certificate file to (mTLS) authenticate with the peer
# tls_cert_file: "/etc/gitlab-runner/ssl/gitlab-runner.cert.pem"
# Client certificate's key file to (mTLS) authenticate with the peer
# tls_key_file: "/etc/gitlab-runner/ssl/gitlab-runner.key.pem"
#
# Custom environment variables injected to build environment
env_vars: []
Expand Down
26 changes: 26 additions & 0 deletions tasks/update-config-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,32 @@
- restart_gitlab_runner
- restart_gitlab_runner_macos

- name: "{{ runn_name_prefix }} Set tls-cert-file option"
lineinfile:
dest: "{{ temp_runner_config.path }}"
regexp: '^\s*tls-cert-file ='
line: ' tls-cert-file = {{ gitlab_runner.tls_cert_file|default([]) | to_json }}'
state: "{{ 'present' if gitlab_runner.tls_cert_file is defined else 'absent' }}"
insertafter: '^\s*url ='
backrefs: no
check_mode: no
notify:
- restart_gitlab_runner
- restart_gitlab_runner_macos

- name: "{{ runn_name_prefix }} Set tls-key-file option"
lineinfile:
dest: "{{ temp_runner_config.path }}"
regexp: '^\s*tls-key-file ='
line: ' tls-key-file = {{ gitlab_runner.tls_key_file|default([]) | to_json }}'
state: "{{ 'present' if gitlab_runner.tls_key_file is defined else 'absent' }}"
insertafter: '^\s*url ='
backrefs: no
check_mode: no
notify:
- restart_gitlab_runner
- restart_gitlab_runner_macos

#### [[runners.docker.services]] section ####
- name: "{{ runn_name_prefix }} Set additional services"
blockinfile:
Expand Down

0 comments on commit 51ba7ff

Please sign in to comment.