updated yum config
diff --git a/tasks/main.yml b/tasks/main.yml index 3f28ae8..c506a37 100644 --- a/tasks/main.yml +++ b/tasks/main.yml
@@ -1,20 +1,9 @@ --- # tasks file for apigee-opdk-setup-local-repository -- name: Install the local mirror - shell: "{{ apigee_service }} apigee-mirror install" +- name: Install the local mirror with no proxy + include: with_no_proxy.yml + when: https_proxy is not defined and http_proxy is not defined -- name: Clear the local mirror data directory - shell: "{{ apigee_service }} apigee-mirror clean" - register: result - -- name: Sync the local mirror with only new rpms - shell: "{{ apigee_service }} apigee-mirror sync --only-new-rpms apigeereleasever={{ apigee_mirror_version }}" - when: all_rpms is not defined and not all_rpms == bool | True - -- name: Sync the local mirror with all rpms - shell: "{{ apigee_service }} apigee-mirror sync apigeereleasever={{ apigee_mirror_version }}" - when: all_rpms is defined and all_rpms == bool | True - -- name: Create archive - shell: "{{ apigee_service }} apigee-mirror package" - register: result +- name: Install the local mirror with no proxy + include: with_proxy.yml + when: https_proxy is defined and http_proxy is defined
diff --git a/tasks/with_no_proxy.yml b/tasks/with_no_proxy.yml new file mode 100644 index 0000000..baffd62 --- /dev/null +++ b/tasks/with_no_proxy.yml
@@ -0,0 +1,20 @@ +--- +# tasks file for apigee-opdk-setup-local-repository +- name: Install the local mirror with no proxy + shell: "{{ apigee_service }} apigee-mirror install" + +- name: Clear the local mirror data directory with no proxy + shell: "{{ apigee_service }} apigee-mirror clean" + register: result + +- name: Sync the local mirror with only new rpms with no proxy + shell: "{{ apigee_service }} apigee-mirror sync --only-new-rpms apigeereleasever={{ apigee_mirror_version }}" + when: all_rpms is not defined and not all_rpms == bool | True + +- name: Sync the local mirror with all rpms with no proxy + shell: "{{ apigee_service }} apigee-mirror sync apigeereleasever={{ apigee_mirror_version }}" + when: all_rpms is defined and all_rpms == bool | True + +- name: Create archive with no proxy + shell: "{{ apigee_service }} apigee-mirror package" + register: result
diff --git a/tasks/with_proxy.yml b/tasks/with_proxy.yml new file mode 100644 index 0000000..5646110 --- /dev/null +++ b/tasks/with_proxy.yml
@@ -0,0 +1,41 @@ +--- +# tasks file for apigee-opdk-setup-local-repository +- name: Install the local mirror with proxy + shell: "{{ apigee_service }} apigee-mirror install" + environment: + no_proxy: "{{ no_proxy }}" + http_proxy: "{{ http_proxy }}" + https_proxy: "{{ https_proxy }}" + + +- name: Clear the local mirror data directory with proxy + shell: "{{ apigee_service }} apigee-mirror clean" + register: result + environment: + no_proxy: "{{ no_proxy }}" + http_proxy: "{{ http_proxy }}" + https_proxy: "{{ https_proxy }}" + +- name: Sync the local mirror with only new rpms with proxy + shell: "{{ apigee_service }} apigee-mirror sync --only-new-rpms apigeereleasever={{ apigee_mirror_version }}" + when: all_rpms is not defined and not all_rpms == bool | True + environment: + no_proxy: "{{ no_proxy }}" + http_proxy: "{{ http_proxy }}" + https_proxy: "{{ https_proxy }}" + +- name: Sync the local mirror with all rpms with proxy + shell: "{{ apigee_service }} apigee-mirror sync apigeereleasever={{ apigee_mirror_version }}" + when: all_rpms is defined and all_rpms == bool | True + environment: + no_proxy: "{{ no_proxy }}" + http_proxy: "{{ http_proxy }}" + https_proxy: "{{ https_proxy }}" + +- name: Create archive with proxy + shell: "{{ apigee_service }} apigee-mirror package" + register: result + environment: + no_proxy: "{{ no_proxy }}" + http_proxy: "{{ http_proxy }}" + https_proxy: "{{ https_proxy }}"