Merge pull request #230 from rsmitty/issue-229
Issue-229: Support Proxies in Docker Daemonpull/244/head
commit
242e96d251
|
@ -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: ""
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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 %}
|
Loading…
Reference in New Issue