Skip to content

Commit

Permalink
feat: support passing in environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDevMinerTV committed Nov 21, 2024
1 parent 89adb73 commit 4f6d0ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Ansible Collections
- `runner_is_paused`: Optional. If true, runner will not receive any new jobs.
- `runner_run_untagged_builds`: Optional. Register to run untagged builds.
- `runner_tags`: Optional. List of tags.
- `runner_env`: Optional. Dictionary of environment variables available to the
CI jobs.
- `runner_metrics_enabled`: Optional. If true, runner will expose Prometheus
metrics via embedded HTTP server.
- `runner_metrics_listen_address`. Optional. `<host>:<port>` address on which
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ runner_run_untagged_builds: true
runner_tags:
runner_metrics_enabled: false
runner_stop_timeout: 3600
runner_env: {}

runner_docker_volume_mount_daemon: "/etc/docker/daemon.json:/etc/docker/daemon.json:ro"
runner_docker_volume_mount_ssl: "/etc/ssl/certs:/etc/ssl/certs:ro"
Expand Down
1 change: 1 addition & 0 deletions tasks/registration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
--env 'COMPOSE_HTTP_TIMEOUT={{ env_compose_http_timeout }}'
--env 'DOCKER_DRIVER={{ env_docker_driver }}'
--env 'DOCKER_TLS_CERTDIR={{ env_docker_tls_certdir }}'
{{ runner_env | default({}) | map('dict2items') | map('first') | map('join', '=') | map('regex_replace', '^(.*)$', '--env \\1') | join(' ') }}

Check failure on line 56 in tasks/registration.yml

View workflow job for this annotation

GitHub Actions / Lint role

yaml[line-length]

Line too long (146 > 120 characters)
{{ '--docker-image ' + runner_docker_image if runner_executor == 'docker' else '' }}
{{ '--docker-privileged ' if runner_executor == 'docker' and runner_docker_privileged else '' }}
{{ '--docker-wait-for-services-timeout '
Expand Down

0 comments on commit 4f6d0ed

Please sign in to comment.