From 2249ba3d08d1e6c55bf008609c9e4eace16bd917 Mon Sep 17 00:00:00 2001 From: Michael Gugino Date: Tue, 5 Dec 2017 15:14:49 -0500 Subject: Implement container_runtime playbooks and changes This commit refactors some duplicate code, removes usage of set_fact where not needed, and reorganizes container_runtime role to use include_role. --- .../tasks/common/atomic_proxy.yml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 roles/container_runtime/tasks/common/atomic_proxy.yml (limited to 'roles/container_runtime/tasks/common/atomic_proxy.yml') diff --git a/roles/container_runtime/tasks/common/atomic_proxy.yml b/roles/container_runtime/tasks/common/atomic_proxy.yml new file mode 100644 index 000000000..dde099984 --- /dev/null +++ b/roles/container_runtime/tasks/common/atomic_proxy.yml @@ -0,0 +1,32 @@ +--- +# Set http_proxy, https_proxy, and no_proxy in /etc/atomic.conf +# regexp: the line starts with or without #, followed by the string +# http_proxy, then either : or = +- block: + + - name: Add http_proxy to /etc/atomic.conf + lineinfile: + dest: /etc/atomic.conf + regexp: "^#?http_proxy[:=]{1}" + line: "http_proxy: {{ openshift.common.http_proxy | default('') }}" + when: + - openshift.common.http_proxy is defined + - openshift.common.http_proxy != '' + + - name: Add https_proxy to /etc/atomic.conf + lineinfile: + dest: /etc/atomic.conf + regexp: "^#?https_proxy[:=]{1}" + line: "https_proxy: {{ openshift.common.https_proxy | default('') }}" + when: + - openshift.common.https_proxy is defined + - openshift.common.https_proxy != '' + + - name: Add no_proxy to /etc/atomic.conf + lineinfile: + dest: /etc/atomic.conf + regexp: "^#?no_proxy[:=]{1}" + line: "no_proxy: {{ openshift.common.no_proxy | default('') }}" + when: + - openshift.common.no_proxy is defined + - openshift.common.no_proxy != '' -- cgit v1.2.1