|
| 1 | +concurrent = {{ gitlab_runner_concurrent }} |
| 2 | +{% if gitlab_runner_check_interval is defined %} |
| 3 | +check_interval = {{ gitlab_runner_check_interval }} |
| 4 | +{% endif %} |
| 5 | +{% if gitlab_runner_listen_address | length > 0 %} |
| 6 | +listen_address = {{ gitlab_runner_listen_address | tojson }} |
| 7 | +{% endif %} |
| 8 | +{% if gitlab_runner_log_format is defined %} |
| 9 | +log_format = {{ gitlab_runner_log_format | default("runner") }} |
| 10 | +{% endif %} |
| 11 | +{% if gitlab_runner_log_level is defined %} |
| 12 | +log_level = {{ gitlab_runner_log_level }} |
| 13 | +{% endif %} |
| 14 | +{% if gitlab_runner_sentry_dsn | length > 0 %} |
| 15 | +sentry_dsn = "{{ gitlab_runner_sentry_dsn }}" |
| 16 | +{% endif %} |
| 17 | +{% if gitlab_runner_session_server is defined %} |
| 18 | +[session_server] |
| 19 | +{% if gitlab_runner_session_server.listen_address | length > 0 %} |
| 20 | + listen_address = {{ gitlab_runner_session_server.listen_address }} |
| 21 | +{% endif %} |
| 22 | +{% if gitlab_runner_session_server.advertise_address | length > 0 %} |
| 23 | + advertise_address = {{ gitlab_runner_session_server.advertise_address }} |
| 24 | +{% endif %} |
| 25 | +{% if gitlab_runner_session_server.session_timeout is defined and gitlab_runner_session_server.session_timeout > 0 %} |
| 26 | + session_timeout = {{ gitlab_runner_session_server.session_timeout }} |
| 27 | +{% endif %} |
| 28 | +{% endif %} |
| 29 | + |
| 30 | +{% for gitlab_runner in gitlab_runner_runners %} |
| 31 | +[[runners]] |
| 32 | + name = {{ gitlab_runner.name | tojson }} |
| 33 | + limit = {{ gitlab_runner.concurrent_specific | default(0) }} |
| 34 | + url = {{ gitlab_runner.url | default(gitlab_runner_coordinator_url) | tojson }} |
| 35 | +{% if gitlab_runner.clone_url is defined %} |
| 36 | + clone_url = {{ gitlab_runner.clone_url | tojson }} |
| 37 | +{% endif %} |
| 38 | + environment = {{ gitlab_runner.env_vars | default([]) | tojson }} |
| 39 | +{% if gitlab_runner.pre_get_sources_script is defined %} |
| 40 | + pre_get_sources_script = {{ gitlab_runner.pre_get_sources_script | tojson }} |
| 41 | +{% endif %} |
| 42 | +{% if gitlab_runner.post_get_sources_script is defined %} |
| 43 | + post_get_sources_script = {{ gitlab_runner.post_get_sources_script | tojson }} |
| 44 | +{% endif %} |
| 45 | +{% if gitlab_runner.pre_build_script is defined %} |
| 46 | + pre_build_script = {{ gitlab_runner.pre_build_script | tojson }} |
| 47 | +{% endif %} |
| 48 | +{% if gitlab_runner.tls_ca_file is defined %} |
| 49 | + tls-ca-file = {{ gitlab_runner.tls_ca_file | tojson }} |
| 50 | +{% endif %} |
| 51 | +{% if gitlab_runner.tls_cert_file is defined %} |
| 52 | + tls-cert-file = {{ gitlab_runner.tls_cert_file | default([]) | tojson }} |
| 53 | +{% endif %} |
| 54 | +{% if gitlab_runner.tls_key_file is defined %} |
| 55 | + tls-key-file = {{ gitlab_runner.tls_key_file | default([]) | tojson }} |
| 56 | +{% endif %} |
| 57 | +{% if gitlab_runner.post_build_script is defined %} |
| 58 | + post_build_script = {{ gitlab_runner.post_build_script | tojson }} |
| 59 | +{% endif %} |
| 60 | + executor = {{ gitlab_runner.executor | default("shell") | tojson }} |
| 61 | +{% if gitlab_runner.builds_dir is defined %} |
| 62 | + builds_dir = {{ gitlab_runner.builds_dir | default("") | tojson }} |
| 63 | +{% endif %} |
| 64 | +{% if gitlab_runner.cache_dir is defined %} |
| 65 | + cache_dir = {{ gitlab_runner.cache_dir | default("") | tojson }} |
| 66 | +{% endif %} |
| 67 | +{% if gitlab_runner.shell is defined %} |
| 68 | + shell = {{ gitlab_runner.shell | default("") | tojson }} |
| 69 | +{% endif %} |
| 70 | + output_limit = {{ gitlab_runner.output_limit | default(4096) }} |
| 71 | + id = {{ gitlab_runner.id }} |
| 72 | + token = {{ gitlab_runner.token | tojson }} |
| 73 | + token_obtained_at = {{ gitlab_runner.token_obtained_at }} |
| 74 | + token_expires_at = {{gitlab_runner.token_expires_at | default("0001-01-01T00:00:00Z") }} |
| 75 | +{#### [runners.docker] section ####} |
| 76 | +{% if gitlab_runner.executor == "docker" or gitlab_runner.executor == "docker+machine" %} |
| 77 | + [runners.docker] |
| 78 | + image = {{ gitlab_runner.docker_image | default("") | tojson }} |
| 79 | +{% if gitlab_runner.docker_helper_image is defined %} |
| 80 | + helper_image = {{ gitlab_runner.docker_helper_image | default("") | tojson }} |
| 81 | +{% endif %} |
| 82 | +{% if gitlab_runner.docker_privileged is defined %} |
| 83 | + privileged = {{ gitlab_runner.docker_privileged | default(false) | lower }} |
| 84 | +{% endif %} |
| 85 | +{% if gitlab_runner.docker_wait_for_services_timeout is defined %} |
| 86 | + wait_for_services_timeout = {{ gitlab_runner.docker_wait_for_services_timeout | default(30) }} |
| 87 | +{% endif %} |
| 88 | +{% if gitlab_runner.docker_tls_verify is defined %} |
| 89 | + tls_verify = {{ gitlab_runner.docker_tls_verify | default(false) | lower }} |
| 90 | +{% endif %} |
| 91 | +{% if gitlab_runner.docker_shm_size is defined %} |
| 92 | + shm_size = {{ gitlab_runner.docker_shm_size | default(false) | lower }} |
| 93 | +{% endif %} |
| 94 | +{% if gitlab_runner.docker_disable_cache is defined %} |
| 95 | + disable_cache = {{ gitlab_runner.docker_disable_cache | default(false) | lower }} |
| 96 | +{% endif %} |
| 97 | +{% if gitlab_runner.docker_dns is defined %} |
| 98 | + dns = {{ gitlab_runner.docker_dns | default(false) | tojson }} |
| 99 | +{% endif %} |
| 100 | +{% if gitlab_runner.docker_dns_search is defined %} |
| 101 | + dns_search = {{ gitlab_runner.docker_dns_search | default(false) | tojson }} |
| 102 | +{% endif %} |
| 103 | +{% if gitlab_runner.docker_pull_policy is defined %} |
| 104 | + pull_policy = {{ gitlab_runner.docker_pull_policy | default([]) | tojson }} |
| 105 | +{% endif %} |
| 106 | +{% if gitlab_runner.docker_allowed_pull_policies is defined %} |
| 107 | + allowed_pull_policies = {{ gitlab_runner.docker_allowed_pull_policies | default([]) | tojson }} |
| 108 | +{% endif %} |
| 109 | +{% if gitlab_runner.docker_volumes is defined %} |
| 110 | + volumes = {{ gitlab_runner.docker_volumes | default([]) | tojson }} |
| 111 | +{% endif %} |
| 112 | +{% if gitlab_runner.docker_devices is defined %} |
| 113 | + devices = {{ gitlab_runner.docker_devices | default([]) | tojson }} |
| 114 | +{% endif %} |
| 115 | +{% if gitlab_runner.docker_network_mode is defined %} |
| 116 | + network_mode = {{ gitlab_runner.docker_network_mode | default("bridge") | tojson }} |
| 117 | +{% endif %} |
| 118 | +{% if gitlab_runner.docker_disable_entrypoint_overwrite is defined %} |
| 119 | + disable_entrypoint_overwrite = {{ gitlab_runner.docker_disable_entrypoint_overwrite | default(false) | tojson }} |
| 120 | +{% endif %} |
| 121 | +{% if gitlab_runner.docker_oom_kill_disable is defined %} |
| 122 | + oom_kill_disable = {{ gitlab_runner.docker_oom_kill_disable | default(false) | tojson }} |
| 123 | +{% endif %} |
| 124 | +{% if gitlab_runner.docker_security_opt is defined %} |
| 125 | + security_opt = {{ gitlab_runner.docker_security_opt | tojson }} |
| 126 | +{% endif %} |
| 127 | +{#### [[runners.docker.services]] section ####} |
| 128 | +{% if gitlab_runner.docker_services is defined %} |
| 129 | +{% for service in gitlab_runner.docker_services %} |
| 130 | + [[runners.docker.services]] |
| 131 | +{% for attr in service %} |
| 132 | + {{ attr }} = {{ service[attr] | to_json }} |
| 133 | +{% endfor %} |
| 134 | +{% endfor %} |
| 135 | +{% endif %} |
| 136 | +{% endif %} |
| 137 | +{#### [runners.ssh] section #####} |
| 138 | +{% if gitlab_runner.executor == "ssh" %} |
| 139 | + [runners.ssh] |
| 140 | +{% if gitlab_runner.ssh_host is defined %} |
| 141 | + host = {{ gitlab_runner.ssh_host | default("") | tojson }} |
| 142 | +{% endif %} |
| 143 | +{% if gitlab_runner.ssh_user is defined %} |
| 144 | + user = {{ gitlab_runner.ssh_user | default("") | tojson }} |
| 145 | +{% endif %} |
| 146 | +{% if gitlab_runner.ssh_port is defined %} |
| 147 | + port = {{ gitlab_runner.ssh_port | default("") | tojson }} |
| 148 | +{% endif %} |
| 149 | +{% if gitlab_runner.ssh_password is defined %} |
| 150 | + password = {{ gitlab_runner.ssh_password | default("") | tojson }} |
| 151 | +{% endif %} |
| 152 | +{% if gitlab_runner.ssh_identity_file is defined %} |
| 153 | + identity_file = {{ gitlab_runner.ssh_identity_file | default("") | tojson }} |
| 154 | +{% endif %} |
| 155 | +{% endif %} |
| 156 | +{#### [runners.virtualbox] section #####} |
| 157 | +{% if gitlab_runner.executor == "virtualbox" %} |
| 158 | + [runners.virtualbox] |
| 159 | +{% if gitlab_runner.virtualbox_base_name is defined %} |
| 160 | + base_name = {{ gitlab_runner.virtualbox_base_name | default("") | tojson }} |
| 161 | +{% endif %} |
| 162 | +{% if gitlab_runner.virtualbox_base_snapshot is defined %} |
| 163 | + base_snapshot = {{ gitlab_runner.virtualbox_base_snapshot | tojson }} |
| 164 | +{% endif %} |
| 165 | +{% if gitlab_runner.virtualbox_base_folder is defined %} |
| 166 | + base_folder = {{ gitlab_runner.virtualbox_base_folder | tojson }} |
| 167 | +{% endif %} |
| 168 | +{% if gitlab_runner.virtualbox_disable_snapshots is defined %} |
| 169 | + disable_snapshots = {{ gitlab_runner.virtualbox_disable_snapshots | default(false) | lower }} |
| 170 | +{% endif %} |
| 171 | +{#### [runners.custom_build_dir] section #####} |
| 172 | +{% if gitlab_runner.custom_build_dir_enabled is defined %} |
| 173 | + [runners.custom_build_dir] |
| 174 | + enabled = {{ gitlab_runner.custom_build_dir_enabled | default(false) | lower }} |
| 175 | +{% endif %} |
| 176 | +{% endif %} |
| 177 | +{#### [runners.cache] section ####} |
| 178 | + [runners.cache] |
| 179 | +{% if gitlab_runner.cache_type is defined %} |
| 180 | + Type = {{ gitlab_runner.cache_type | default("") | to_json }} |
| 181 | +{% endif %} |
| 182 | +{% if gitlab_runner.cache_path is defined %} |
| 183 | + Path = {{ gitlab_runner.cache_path | default("") | to_json }} |
| 184 | +{% endif %} |
| 185 | +{% if gitlab_runner.cache_shared is defined %} |
| 186 | + Shared = {{ gitlab_runner.cache_shared | default("") | lower }} |
| 187 | +{% endif %} |
| 188 | +{#### [runners.cache.s3] section ####} |
| 189 | +{% if gitlab_runner.cache_s3_bucket_name is defined %} |
| 190 | + [runners.cache.s3] |
| 191 | + BucketName = {{ gitlab_runner.cache_s3_bucket_name | default("") | tojson }} |
| 192 | +{% if gitlab_runner.cache_s3_server_address is defined %} |
| 193 | + ServerAddress = {{ gitlab_runner.cache_s3_server_address | default("") | tojson }} |
| 194 | +{% endif %} |
| 195 | +{% if gitlab_runner.cache_s3_access_key is defined %} |
| 196 | + AccessKey = {{ gitlab_runner.cache_s3_access_key | default("") | tojson }} |
| 197 | +{% endif %} |
| 198 | +{% if gitlab_runner.cache_s3_secret_key is defined %} |
| 199 | + SecretKey = {{ gitlab_runner.cache_s3_secret_key | default("") | tojson }} |
| 200 | +{% endif %} |
| 201 | +{% if gitlab_runner.cache_s3_bucket_location is defined %} |
| 202 | + BucketLocation = {{ gitlab_runner.cache_s3_bucket_location | default("") | tojson }} |
| 203 | +{% endif %} |
| 204 | +{% if gitlab_runner.cache_s3_insecure %} |
| 205 | + Insecure = {{ gitlab_runner.cache_s3_insecure | default("") | lower }} |
| 206 | +{% endif %} |
| 207 | +{% endif %} |
| 208 | +{#### [runners.cache.gcs] section ####} |
| 209 | +{% if gitlab_runner.cache_gcs_bucket_name is defined %} |
| 210 | + [runners.cache.gcs] |
| 211 | + BucketName = {{ gitlab_runner.cache_gcs_bucket_name | default("") | tojson }} |
| 212 | +{% if gitlab_runner.cache_gcs_credentials_file is defined %} |
| 213 | + CredentialsFile = {{ gitlab_runner.cache_gcs_credentials_file | default("") | tojson }} |
| 214 | +{% endif %} |
| 215 | +{% if gitlab_runner.cache_gcs_access_id is defined %} |
| 216 | + AccessID = {{ gitlab_runner.cache_gcs_access_id | default("") | tojson }} |
| 217 | +{% endif %} |
| 218 | +{% if gitlab_runner.cache_gcs_private_key is defined %} |
| 219 | + PrivateKey = {{ gitlab_runner.cache_gcs_private_key | default("") | tojson }} |
| 220 | +{% endif %} |
| 221 | +{% endif %} |
| 222 | +{#### [runners.cache.azure] section ####} |
| 223 | +{% if gitlab_runner.cache_azure_account_name is defined %} |
| 224 | + [runners.cache.azure] |
| 225 | + AccountName = {{ gitlab_runner.cache_azure_account_name | default("") | tojson }} |
| 226 | +{% if gitlab_runner.cache_azure_account_key is defined %} |
| 227 | + AccountKey = {{ gitlab_runner.cache_azure_account_key | default("") | tojson }} |
| 228 | +{% endif %} |
| 229 | +{% if gitlab_runner.cache_azure_container_name is defined %} |
| 230 | + ContainerName = {{ gitlab_runner.cache_azure_container_name | default("") | to_json }} |
| 231 | +{% endif %} |
| 232 | +{% if gitlab_runner.cache_azure_storage_domain is defined %} |
| 233 | + StorageDomain = {{ gitlab_runner.cache_azure_storage_domain | default("") | to_json }} |
| 234 | +{% endif %} |
| 235 | +{% endif %} |
| 236 | +{% if gitlab_runner.feature_flags is defined %} |
| 237 | + [runners.feature_flags] |
| 238 | +{% for flag in gitlab_runner.feature_flags %} |
| 239 | + {{ flag }} = true |
| 240 | +{% endfor %} |
| 241 | +{% endif %} |
| 242 | +{#### [runners.machine] section ####} |
| 243 | +{% if gitlab_runner.machine_MachineOptions is defined %} |
| 244 | + [runners.machine] |
| 245 | + MachineOptions = {{ gitlab_runner.machine_MachineOptions | default("") | tojson }} |
| 246 | +{% if gitlab_runner.machine_MaxGrowthRate is defined %} |
| 247 | + MaxGrowthRate = {{ gitlab_runner.machine_MaxGrowthRate | default("") | tojson }} |
| 248 | +{% endif %} |
| 249 | +{% if gitlab_runner.machine_IdleCount is defined %} |
| 250 | + IdleCount = {{ gitlab_runner.machine_IdleCount | default("") | tojson }} |
| 251 | +{% endif %} |
| 252 | +{% if gitlab_runner.machine_IdleScaleFactor is defined %} |
| 253 | + IdleScaleFactor = {{ gitlab_runner.machine_IdleScaleFactor | default("") | tojson }} |
| 254 | +{% endif %} |
| 255 | +{% if gitlab_runner.machine_IdleCountMin is defined %} |
| 256 | + IdleCountMin = {{ gitlab_runner.machine_IdleCountMin | default("") | tojson }} |
| 257 | +{% endif %} |
| 258 | +{% if gitlab_runner.machine_IdleTime is defined %} |
| 259 | + IdleTime = {{ gitlab_runner.machine_IdleTime | default("") | tojson }} |
| 260 | +{% endif %} |
| 261 | +{% if gitlab_runner.machine_MaxBuilds is defined %} |
| 262 | + MaxBuilds = {{ gitlab_runner.machine_MaxBuilds | default("") | tojson }} |
| 263 | +{% endif %} |
| 264 | +{% if gitlab_runner.machine_MachineName is defined %} |
| 265 | + MachineName = {{ gitlab_runner.machine_MachineName | default("") | tojson }} |
| 266 | +{% endif %} |
| 267 | +{% if gitlab_runner.machine_MachineDriver is defined %} |
| 268 | + MachineDriver = {{ gitlab_runner.machine_MachineDriver | default("") | tojson }} |
| 269 | +{% endif %} |
| 270 | +{% endif %} |
| 271 | +{#### [runners.autoscaler] section ####} |
| 272 | +{% if gitlab_runner.machine_autoscaling is defined %} |
| 273 | + [runners.autoscaler] |
| 274 | + plugin = "{{ gitlab_runner.autoscaler.plugin }}" # for >= 16.11, ensure you run `gitlab-runner fleeting install` to automatically install the plugin |
| 275 | + capacity_per_instance = {{ gitlab_runner.autoscaler.capacity_per_instance }} |
| 276 | + max_use_count = {{ gitlab_runner.autoscaler.max_use_count }} |
| 277 | + max_instances = {{ gitlab_runner.autoscaler.max_instances }} |
| 278 | + [runners.autoscaler.plugin_config] |
| 279 | +{% if gitlab_runner.autoscaler.plugin_config.name is defined %} |
| 280 | + name = "{{ gitlab_runner.autoscaler.plugin_config.name }}" |
| 281 | +{% endif %} |
| 282 | +{% if gitlab_runner.autoscaler.plugin_config.profile is defined %} |
| 283 | + profile = "{{ gitlab_runner.autoscaler.plugin_config.profile }}" |
| 284 | +{% endif %} |
| 285 | +{% if gitlab_runner.autoscaler.plugin_config.config_file is defined %} |
| 286 | + config_file = "{{ gitlab_runner.autoscaler.plugin_config.config_file }}" |
| 287 | +{% endif %} |
| 288 | +{% if gitlab_runner.autoscaler.plugin_config.credentials_file is defined %} |
| 289 | + credentials_file = "{{ gitlab_runner.autoscaler.plugin_config.credentials_file }}" |
| 290 | +{% endif %} |
| 291 | +{% if gitlab_runner.autoscaler.plugin_config.subscription_id is defined %} |
| 292 | + subscription_id = "{{ gitlab_runner.autoscaler.plugin_config.subscription_id }}" |
| 293 | +{% endif %} |
| 294 | +{% if gitlab_runner.autoscaler.plugin_config.resource_group_name is defined %} |
| 295 | + resource_group_name = "{{ gitlab_runner.autoscaler.plugin_config.resource_group_name }}" |
| 296 | +{% endif %} |
| 297 | +{% if gitlab_runner.autoscaler.plugin_config.project is defined %} |
| 298 | + project = "{{ gitlab_runner.autoscaler.plugin_config.project }}" |
| 299 | +{% endif %} |
| 300 | +{% if gitlab_runner.autoscaler.plugin_config.zone is defined %} |
| 301 | + zone = "{{ gitlab_runner.autoscaler.plugin_config.zone }}" |
| 302 | +{% endif %} |
| 303 | +{% if gitlab_runner.autoscaler.plugin_config.endpoint is defined %} |
| 304 | + endpoint = "{{ gitlab_runner.autoscaler.plugin_config.endpoint }}" |
| 305 | +{% endif %} |
| 306 | + [runners.autoscaler.connector_config] |
| 307 | +{% for key, value in gitlab_runner.autoscaler.connector_config.items() %} |
| 308 | + {{ key }} = {{ '"' ~ value ~ '"' if value is string else value | lower if value is boolean else value }} |
| 309 | +{% endfor %} |
| 310 | + |
| 311 | +{% for policy in gitlab_runner.autoscaler.policies %} |
| 312 | + [[runners.autoscaler.policy]] |
| 313 | + {% for key, value in policy.items() %} |
| 314 | + {{ key }} = {{ '"' ~ value ~ '"' if value is string else value | lower if value is boolean else value }} |
| 315 | + {% endfor %} |
| 316 | +{% endfor %} |
| 317 | +{% endif %} |
| 318 | +{#### [[runners.machine.autoscaling]] section ####} |
| 319 | +{% if gitlab_runner.machine_autoscaling is defined %} |
| 320 | +{% for machine in gitlab_runner.machine_autoscaling %} |
| 321 | + [[runners.machine.autoscaling]] |
| 322 | +{% for attr in machine %} |
| 323 | + {{ attr }} = {{ machine[attr] | to_json }} |
| 324 | +{% endfor %} |
| 325 | +{% endfor %} |
| 326 | +{% endif %} |
| 327 | + |
| 328 | +{% endfor %} |
0 commit comments