Skip to content

Conversation

@darmach
Copy link
Member

@darmach darmach commented Nov 21, 2025

Conditionally sets custom_env fact to leverage
monolithprojects.github_actions_runner role support for seting proxy for deployed Github runners.

Confirmed working on environment with mandatory proxy ONLY - it would be great if someone could give this a go in non-proxy setup. With custom_env defined monolithprojects role creates .env file in /opt/actions*... directory (per runner) which is ingested by the running runner (ran on the runner VM ,)

@darmach darmach requested a review from a team as a code owner November 21, 2025 14:22
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds proxy support for GitHub runners by setting a custom_env fact. The overall approach is good, but there is a critical issue in how the no_proxy variable is constructed which could cause the Ansible playbook to fail. I've provided a suggestion to fix this and make the implementation more robust.

Comment on lines +11 to +14
custom_env: |
http_proxy={{ http_proxy | default('') }}
https_proxy={{ https_proxy | default('') }}
no_proxy=localhost,127.0.0.1,127.0.0.2,{{ no_proxy | default('') | join(',') }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The current implementation for no_proxy will cause an error if the no_proxy variable is not defined. The default('') filter provides an empty string, and the join filter cannot be used on a string, which will cause a fatal error during playbook execution.

I suggest constructing the full list of no_proxy entries first and then joining them. This approach fixes the error and also avoids a potential trailing comma in the no_proxy value, making it more robust.

        custom_env: |
          http_proxy={{ http_proxy | default('') }}
          https_proxy={{ https_proxy | default('') }}
          no_proxy={{ (['localhost', '127.0.0.1', '127.0.0.2'] + (no_proxy | default([]))) | join(',') }}

Conditionally define custom_env fact to leverage
monolithprojects.github_actions_runner role support for
setting proxy on deployed Github runners.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants