|
51 | 51 | - "{{ __hpc_nvidia_cuda_repo }}" |
52 | 52 | - "{{ __hpc_microsoft_prod_repo }}" |
53 | 53 |
|
| 54 | +- name: Replace default RHUI Azure repository with the EUS repository |
| 55 | + when: hpc_enable_eus_repo |
| 56 | + block: |
| 57 | + - name: Get list of installed repositories |
| 58 | + command: dnf repolist |
| 59 | + changed_when: false |
| 60 | + register: __hpc_dnf_repolist |
| 61 | + |
| 62 | + - name: Ensure that the non-EUS RHUI Azure repository is not installed |
| 63 | + package: |
| 64 | + name: rhui-azure-rhel{{ ansible_distribution_major_version }} |
| 65 | + state: absent |
| 66 | + use: "{{ (__hpc_server_is_ostree | d(false)) | |
| 67 | + ternary('ansible.posix.rhel_rpm_ostree', omit) }}" |
| 68 | + |
| 69 | + - name: Enable the RHUI Azure EUS repository |
| 70 | + when: >- |
| 71 | + 'rhui-microsoft-azure-rhel' + ansible_distribution_major_version |
| 72 | + + '-eus ' not in __hpc_dnf_repolist.stdout |
| 73 | + block: |
| 74 | + - name: Create a temp file for the EUS repository configuration |
| 75 | + tempfile: |
| 76 | + state: file |
| 77 | + prefix: rhel{{ ansible_distribution_major_version }}-eus |
| 78 | + suffix: .config |
| 79 | + register: __hpc_euc_config |
| 80 | + |
| 81 | + - name: Generate the repository configuration template |
| 82 | + template: |
| 83 | + src: rhel-ver-eus.config |
| 84 | + dest: "{{ __hpc_euc_config.path }}" |
| 85 | + mode: "0644" |
| 86 | + owner: root |
| 87 | + group: root |
| 88 | + |
| 89 | + - name: Add EUS repository |
| 90 | + command: >- |
| 91 | + dnf --config {{ __hpc_euc_config.path }} install |
| 92 | + rhui-azure-rhel{{ ansible_distribution_major_version }}-eus |
| 93 | + --assumeyes |
| 94 | + changed_when: true |
| 95 | + |
| 96 | + - name: Lock the RHEL minor release to the current minor release |
| 97 | + copy: |
| 98 | + content: "{{ ansible_distribution_version }}" |
| 99 | + dest: /etc/dnf/vars/releasever |
| 100 | + mode: "0644" |
| 101 | + owner: root |
| 102 | + group: root |
| 103 | + |
54 | 104 | - name: Configure firewall to use trusted zone as default |
55 | 105 | when: hpc_manage_firewall |
56 | 106 | include_role: |
|
0 commit comments