| --- |
| - name: Validate that distribution info is available are available |
| setup: |
| when: ansible_distribution_major_version is not defined or ansible_distribution is not defined or ansible_bios_version is not defined |
| |
| - name: Configure AWS AMI OS package manager repositories for Apigee |
| become: yes |
| shell: "/usr/bin/yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional" |
| when: ansible_bios_version | lower | search('amazon') and ansible_distribution | lower != 'redhat' and ansible_distribution_major_version | version_compare('6', '>') |
| |
| - name: Register with Redhat Subscription management |
| become: yes |
| shell: "subscription-manager register --username={{ rhel_user_name }} --password={{ rhel_password }} --auto-attach" |
| when: ansible_distribution | lower == 'redhat' and ansible_distribution_major_version | version_compare('7', '>') |
| |
| - name: Update EPEL with proxy |
| become: yes |
| yum: |
| name: epel-release |
| state: absent |
| when: opdk_version | version_compare('4.16.09', '==') |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| no_proxy: "{{ no_proxy }}" |
| |
| - name: Update EPEL with proxy |
| become: yes |
| yum: |
| name: epel-release |
| state: present |
| allow_downgrade: yes |
| when: opdk_version | version_compare('4.17.05', '>') |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| no_proxy: "{{ no_proxy }}" |
| |
| - block: |
| - name: Remove epel |
| become: yes |
| yum: |
| name: epel-release |
| state: absent |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| no_proxy: "{{ no_proxy }}" |
| |
| - name: Yum clean |
| become: yes |
| shell: "yum clean all" |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| no_proxy: "{{ no_proxy }}" |
| |
| - name: Remove yum cache |
| become: yes |
| file: |
| path: /var/cache/yum |
| state: absent |
| |
| - name: Update EPEL with proxy |
| become: yes |
| yum: |
| name: "{{ epel_repo }}" |
| state: present |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| no_proxy: "{{ no_proxy }}" |
| when: opdk_version | version_compare('4.17.05', '<=') |