updated become user for upgrade
diff --git a/defaults/main.yml b/defaults/main.yml index 9973464..b747018 100644 --- a/defaults/main.yml +++ b/defaults/main.yml
@@ -1,2 +1,4 @@ --- # defaults file for apigee-opdk-yum-packages +yum_exclude_packages: +- ''
diff --git a/tasks/main.yml b/tasks/main.yml index fa9149c..77115a7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml
@@ -1,13 +1,18 @@ --- # tasks file for apigee-opdk-yum-packages - -#- name: Update basic yum os packages with no proxy -# include: with_no_proxy.yml -# when: (https_proxy is not defined or https_proxy | trim == '') and (http_proxy is not defined or http_proxy | trim == '') - -#- name: Update basic yum os packages with proxy -# include: with_proxy.yml -# when: https_proxy is defined and https_proxy | trim != '' and http_proxy is defined and http_proxy | trim != '' +- name: Update basic yum os packages with proxy + become: yes + yum: + name: "{{ item }}" + state: present + exclude: "{{ yum_exclude_packages | join(',') }}" + disable_gpg_check: yes + with_items: "{{ yum_os_minimum_packages }}" + environment: + http_proxy: "{{ http_proxy }}" + https_proxy: "{{ https_proxy }}" + no_proxy: "{{ no_proxy }}" + when: yum_os_minimum_packages is defined and yum_exclude_packages is defined - name: Update basic yum os packages with proxy become: yes @@ -20,4 +25,4 @@ http_proxy: "{{ http_proxy }}" https_proxy: "{{ https_proxy }}" no_proxy: "{{ no_proxy }}" - when: yum_os_minimum_packages is defined + when: yum_os_minimum_packages is defined and yum_exclude_packages is not defined
diff --git a/tasks/with_no_proxy.yml b/tasks/with_no_proxy.yml deleted file mode 100644 index 225fa67..0000000 --- a/tasks/with_no_proxy.yml +++ /dev/null
@@ -1,11 +0,0 @@ ---- -# tasks file for apigee-opdk-yum-packages - -- name: Update basic yum os packages with no proxy - become: yes - yum: - name: "{{ item }}" - state: present - disable_gpg_check: yes - with_items: "{{ yum_os_minimum_packages }}" - when: yum_os_minimum_packages is defined
diff --git a/tasks/with_proxy.yml b/tasks/with_proxy.yml deleted file mode 100644 index 5b36e84..0000000 --- a/tasks/with_proxy.yml +++ /dev/null
@@ -1,15 +0,0 @@ ---- -# tasks file for apigee-opdk-yum-packages - -- name: Update basic yum os packages with proxy - become: yes - yum: - name: "{{ item }}" - state: present - disable_gpg_check: yes - with_items: "{{ yum_os_minimum_packages }}" - environment: - http_proxy: "{{ http_proxy }}" - https_proxy: "{{ https_proxy }}" - no_proxy: "{{ no_proxy }}" - when: yum_os_minimum_packages is defined