Skip to content
Snippets Groups Projects
Commit adceaf60 authored by Spencer Smith's avatar Spencer Smith
Browse files

support proxies with docker on rhel

parent 96c63cc0
No related branches found
No related tags found
No related merge requests found
......@@ -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: ""
......@@ -53,6 +53,11 @@
with_items: "{{ docker_package_info.pkgs }}"
when: docker_package_info.pkgs|length > 0
- name: allow for proxies on RHEL systems
include: rhel-proxies.yml
when: ansible_distribution in ["CentOS","RedHat"] and
ansible_distribution_major_version >= 7
- meta: flush_handlers
- name: ensure docker service is started and enabled
......
---
- name: create docker service directory for RHEL family
file: path=/etc/systemd/system/docker.service.d state=directory
when: ansible_distribution in ["CentOS","RedHat"] and
ansible_distribution_major_version >= 7
- name: drop docker environment for RHEL family
template:
src: http-proxy.conf.j2
dest: /etc/systemd/system/docker.service.d/http-proxy.conf
when: ansible_distribution in ["CentOS","RedHat"] and
ansible_distribution_major_version >= 7
register: rheldockerproxy
- name: reload systemctl daemons for RHEL family
shell: systemctl daemon-reload
when: rheldockerproxy.changed
- name: restart docker for RHEL family
service: name=docker state=restarted
when: rheldockerproxy.changed
[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 %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment