diff --git a/roles/gitlab_runner/defaults/main.yml b/roles/gitlab_runner/defaults/main.yml index 452380f..1cd5504 100644 --- a/roles/gitlab_runner/defaults/main.yml +++ b/roles/gitlab_runner/defaults/main.yml @@ -30,6 +30,9 @@ gitlabrunner_image_variant: "alpine-{{ gitlabrunner_image_version }}" # Extra paths that should be created (eg. to be mounted in the container) gitlabrunner_extra_paths: [] +# Enable or disable selinux handling +gitlabrunner_selinux_enabled: true + # Should the docker socket be mounted to the gitlab runner (usually needed for the docker executor) gitlabrunner_mount_docker_socket: false diff --git a/roles/gitlab_runner/tasks/main.yml b/roles/gitlab_runner/tasks/main.yml index 98f4b89..bdf7c9c 100644 --- a/roles/gitlab_runner/tasks/main.yml +++ b/roles/gitlab_runner/tasks/main.yml @@ -26,6 +26,8 @@ with_items: - "{{ gitlabrunner_config_location }}" - "{{ gitlabrunner_extra_paths }}" + when: + - gitlabrunner_selinux_enabled become: true - name: Create install directory