diff --git a/etc/kayobe/ansible/deployment/deploy-github-runner.yml b/etc/kayobe/ansible/deployment/deploy-github-runner.yml index 8f69d83455..57436a9881 100644 --- a/etc/kayobe/ansible/deployment/deploy-github-runner.yml +++ b/etc/kayobe/ansible/deployment/deploy-github-runner.yml @@ -2,10 +2,31 @@ - name: Deploy GitHub Runner hosts: github-runners become: true + vars: + docker_daemon_options: + proxies: + http-proxy: "{{ http_proxy }}" + https-proxy: "{{ https_proxy }}" + no-proxy: "{{ (['localhost', '127.0.0.1', '127.0.0.2'] + (no_proxy | default([]))) | join(',') }}" + when: > + http_proxy is defined or + https_proxy is defined or + no_proxy is defined roles: - role: geerlingguy.pip - role: geerlingguy.docker tasks: + - name: Set custom_env fact if any proxy variable is defined + ansible.builtin.set_fact: + 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([]))) | unique | join(',') }} + when: > + http_proxy is defined or + https_proxy is defined or + no_proxy is defined + - name: Deploy runners ansible.builtin.include_role: name: monolithprojects.github_actions_runner