Merge pull request #230 from rsmitty/issue-229

Issue-229: Support Proxies in Docker Daemon
pull/244/head
Smaine Kahlouch 2016-05-12 21:25:53 +02:00
commit 242e96d251
5 changed files with 37 additions and 0 deletions

View File

@ -123,3 +123,8 @@ dns_server: "{{ kube_service_addresses|ipaddr('net')|ipaddr(2)|ipaddr('address')
# server master2 10.99.0.27:443
# balance roundrobin
# apiserver_loadbalancer_domain_name: "lb-apiserver.kubernetes.local"
##Set these proxy values in order to update docker daemon to use proxies
#http_proxy: ""
#https_proxy: ""
#no_proxy: ""

View File

@ -0,0 +1,15 @@
---
- name: restart docker
command: /bin/true
notify:
- reload systemd
- reload docker
- name : reload systemd
shell: systemctl daemon-reload
when: ansible_service_mgr == "systemd"
- name: reload docker
service:
name: docker
state: restarted

View File

@ -53,6 +53,11 @@
with_items: "{{ docker_package_info.pkgs }}"
when: docker_package_info.pkgs|length > 0
- name: allow for proxies on systems using systemd
include: systemd-proxies.yml
when: ansible_service_mgr == "systemd" and
(http_proxy is defined or https_proxy is defined or no_proxy is defined)
- meta: flush_handlers
- name: ensure docker service is started and enabled

View File

@ -0,0 +1,9 @@
---
- name: create docker service directory for systemd
file: path=/etc/systemd/system/docker.service.d state=directory
- name: drop docker environment conf to enable proxy usage
template:
src: http-proxy.conf.j2
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
notify: restart docker

View File

@ -0,0 +1,3 @@
[Service]
Environment={% if http_proxy %}"HTTP_PROXY={{ http_proxy }}"{% endif %} {% if https_proxy %}"HTTPS_PROXY={{ https_proxy }}"{% endif %} {% if no_proxy %}"NO_PROXY={{ no_proxy }}"{% endif %}