add proxy_env for docker installation

This commit is contained in:
barryz 2021-09-01 16:54:56 +08:00
parent 4f4c332aa1
commit 4beb35cdbe
3 changed files with 7 additions and 0 deletions

View File

@ -36,3 +36,8 @@ docker_users: []
# Docker daemon options as a dict
docker_daemon_options: {}
# proxy env, if defined, env vars https_proxy and http_proxy will be injected.
proxy_env:
http_proxy: 'http://10.0.45.5:8118'
https_proxy: 'http://10.0.45.5:8118'

View File

@ -18,6 +18,7 @@
url: "{{ docker_compose_url }}"
dest: "{{ docker_compose_path }}"
mode: 0755
environment: "{{ proxy_env }}"
when: >
docker_compose_current_version.stdout is not defined
or docker_compose_version not in docker_compose_current_version.stdout

View File

@ -11,6 +11,7 @@
state: "{{ docker_package_state }}"
notify: restart docker
ignore_errors: "{{ ansible_check_mode }}"
environment: "{{ proxy_env }}"
- name: Ensure /etc/docker/ directory exists.
file: