Merge pull request #29 from cloud-bootstrap/proxy

Proxy Settings for docker
master
Carlos León 7 years ago committed by GitHub
commit 6a20d80422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -56,6 +56,9 @@ So in order to upgrade Docker on managed systems, take the following steps:
host/group vars.
1. Run your playbook with `-e upgrade_docker=True`
### `docker_proxy`, `docker_http_proxy`, `docker_https_proxy`, `docker_no_proxy`
`docker_proxy` specifies if proxy need to be applied. Default value of `docker_proxy` is no. If you need proxy set it to yes and updated other three variables as needed.
Dependencies
------------

@ -3,6 +3,10 @@ consul_ip: 127.0.0.1
docker_clusterstore: no
dockerpy: no
vagrant: no
docker_proxy: no
docker_http_proxy: ""
docker_https_proxy: ""
docker_no_proxy: ""
upgrade_docker: false
default_docker_config:
storage-driver: devicemapper
@ -15,4 +19,4 @@ setup_script_url: "https://releases.rancher.com/install-docker/{{ docker_version
# DO NOT MODIFY THIS UNLESS YOU HAVE SPECIFIED A DIFFERENT "docker_version" or "setup_script_url"
# IF YOU HAVE GENERATED AN MD5 CHECKSUM FOR YOUR DESIRED SETUP SCRIPT, STORE IT IN THIS VARIABLE
# IF YOU REALLY DON'T WANT TO VERIFY CHECKSUM, SET THIS VALUE TO "false" or "no"
setup_script_md5_sum: "6be324016277879d49bd0e7f9f91e546"
setup_script_md5_sum: "6be324016277879d49bd0e7f9f91e546"

@ -31,6 +31,21 @@
docker_json: '{{ docker_json | combine({"cluster-store": "consul://{{ consul_ip }}:8500"})}}'
when: docker_clusterstore
- name: create directory for proxy file
file:
path: /etc/systemd/system/docker.service.d
state: directory
when: docker_proxy
- name: create http-proxy.conf
template:
src: http-proxy.j2.conf
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
notify:
- reload unit
- restart docker
when: docker_proxy
- name: ensure daemon config file is present
template:
src: daemon.j2.json

@ -8,7 +8,7 @@ Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/docker daemon -H unix:///var/run/docker.sock
ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
LimitNPROC=1048576

@ -0,0 +1,2 @@
[Service]
Environment="HTTP_PROXY={{ docker_http_proxy }}" "HTTPS_PROXY={{ docker_https_proxy }}" "NO_PROXY={{ docker_no_proxy }}"
Loading…
Cancel
Save