From 1d467d5a34f446459dc5035b1ec7210fecce9931 Mon Sep 17 00:00:00 2001
From: Scott Dodson <sdodson@redhat.com>
Date: Thu, 11 Feb 2016 11:42:59 -0500
Subject: Add global proxy configuration

Configures HTTP_PROXY, HTTPS_PROXY, NO_PROXY for master and docker services.
Configugres BuildDefaults Admission controller for master to automatically
insert proxy environment configuration into build environments.

To use set at least these variables
  - openshift_http_proxy
  - openshift_https_proxy

NO_PROXY entries will automatically be configured for hostnames of all openshift
hosts. You may specify additional NO_PROXY hosts or patterns by setting
`openshift_no_proxy`

If you wish to disable automatic generation of NO_PROXY hosts you may set
`openshift_generate_no_proxy_hosts` to False.

If you wish to have different builddefaults proxy configuration than baseline
proxy configuration set these variables
  - openshift_builddefaults_http_proxy
  - openshift_builddefaults_https_proxy
  - openshift_builddefaults_no_proxy
  - openshift_builddefaults_git_http_proxy
  - openshift_builddefaults_git_https_proxy
---
 roles/docker/tasks/main.yml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'roles/docker')

diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index 4a47a60fa..0414ff21e 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -69,6 +69,21 @@
     reg_flag: --insecure-registry
   notify:
   - restart docker
+  
+- name: Set Proxy Settings
+  lineinfile:
+    dest: /etc/sysconfig/docker
+    regexp: '^{{ item.reg_conf_var }}=.*$'
+    line: "{{ item.reg_conf_var }}='{{ item.reg_fact_val }}'"
+  with_items:
+    - reg_conf_var: HTTP_PROXY
+      reg_fact_val: "{{ docker_http_proxy | default('') }}"
+    - reg_conf_var: HTTPS_PROXY
+      reg_fact_val: "{{ docker_https_proxy | default('') }}"
+    - reg_conf_var: NO_PROXY
+      reg_fact_val: "{{ docker_no_proxy | default('') | join(',') }}"
+  notify:
+    - restart docker
 
 - name: Set various docker options
   lineinfile:
-- 
cgit v1.2.3