Skip to content

Commit

Permalink
feat: Introduced http(s)_proxy and no_proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser committed Jun 17, 2024
1 parent 916f83d commit 1480d52
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions roles/containerd/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ containerd_limit_core: "infinity"
containerd_limit_open_file_num: "{{ '1048576' if ansible_facts['os_family'] == 'RedHat' else 'infinity' }}"
containerd_limit_mem_lock: "infinity"

containerd_http_proxy: "{{ http_proxy | default('') }}"
containerd_https_proxy: "{{ https_proxy | default('') }}"
containerd_no_proxy: "{{ no_proxy | default('') }}"

# NOTE(jrosser): If you need to override the default containerd snapshotter, for example
# when the underlying filesystem does not support overlayfs, set it here
containerd_snapshotter: ""
10 changes: 9 additions & 1 deletion roles/containerd/templates/containerd.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ After=network.target local-fs.target
[Service]
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/bin/containerd --config {{ containerd_cfg_file }}

{% if containerd_http_proxy %}
Environment="HTTP_PROXY={{ containerd_http_proxy }}"
{% endif %}
{% if containerd_https_proxy %}
Environment="HTTPS_PROXY={{ containerd_https_proxy }}"
{% endif %}
{% if containerd_no_proxy %}
Environment="NO_PROXY={{ containerd_no_proxy }}"
{% endif %}
Type=notify
Delegate=yes
KillMode=process
Expand Down
4 changes: 4 additions & 0 deletions roles/download_artifact/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ download_artifact_validate_certs: true
# download_artifact_url_username:
# download_artifact_url_password:

download_artifact_http_proxy: "{{ http_proxy | default('') }}"
download_artifact_https_proxy: "{{ https_proxy | default('') }}"
download_artifact_no_proxy: "{{ no_proxy | default('') }}"

# NOTE(fitbeard): If this is false, debug information will be displayed but may
# contain some private data, so it is recommended to set it to
# true a production environment.
Expand Down
4 changes: 4 additions & 0 deletions roles/download_artifact/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
# environment passwords in the log.
no_log: "{{ download_artifact_no_log | bool }}"
notify: "{{ download_artifact_notify }}"
environment:
http_proxy: "{{ download_artifact_http_proxy }}"
https_proxy: "{{ download_artifact_https_proxy }}"
no_proxy: "{{ download_artifact_no_proxy }}"

- name: Extract archive
when: download_artifact_unarchive and not ansible_check_mode
Expand Down

0 comments on commit 1480d52

Please sign in to comment.