소스 검색

Merge pull request #2443 from sdodson/bz1375031

Define proxy settings for node services
Andrew Butcher 8 년 전
부모
커밋
872aafbe7a
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 17 0
      roles/openshift_node/tasks/systemd_units.yml

+ 17 - 0
roles/openshift_node/tasks/systemd_units.yml

@@ -48,6 +48,23 @@
   notify:
   notify:
   - restart node
   - restart node
 
 
+- name: Configure Proxy Settings
+  lineinfile:
+    dest: /etc/sysconfig/{{ openshift.common.service_type }}-node
+    regexp: "{{ item.regex }}"
+    line: "{{ item.line }}"
+    create: true
+  with_items:
+    - regex: '^HTTP_PROXY='
+      line: "HTTP_PROXY={{ openshift.common.http_proxy }}"
+    - regex: '^HTTPS_PROXY='
+      line: "HTTPS_PROXY={{ openshift.common.https_proxy }}"
+    - regex: '^NO_PROXY='
+      line: "NO_PROXY={{ openshift.common.no_proxy | join(',') }}"
+  when: "{{ openshift.common.http_proxy is defined and openshift.common.http_proxy != '' }}"
+  notify:
+  - restart node
+
 - name: Reload systemd units
 - name: Reload systemd units
   command: systemctl daemon-reload
   command: systemctl daemon-reload
   when: openshift.common.is_containerized | bool and (install_node_result | changed or install_ovs_sysconfig | changed or install_node_dep_result | changed)
   when: openshift.common.is_containerized | bool and (install_node_result | changed or install_ovs_sysconfig | changed or install_node_dep_result | changed)