|  | 
| 13 | 13 | # See the License for the specific language governing permissions and | 
| 14 | 14 | # limitations under the License. | 
| 15 | 15 | 
 | 
| 16 |  | -- name: Load support matrix variables for OS | 
| 17 |  | -  ansible.builtin.include_vars: "{{ item }}" | 
| 18 |  | -  with_first_found: | 
| 19 |  | -    - "../../prereq_supported/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml" | 
| 20 |  | -    - "../../prereq_supported/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" | 
| 21 |  | -    - "../../prereq_supported/vars/{{ ansible_facts['distribution'] }}.yml" | 
| 22 |  | -    - "../../prereq_supported/vars/{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_version'] }}.yml" | 
| 23 |  | -    - "../../prereq_supported/vars/{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" | 
| 24 |  | -    - "../../prereq_supported/vars/{{ ansible_facts['os_family'] }}.yml" | 
| 25 |  | -    - "../../prereq_supported/vars/default.yml" | 
|  | 16 | +- name: Gather distribution details | 
|  | 17 | +  ansible.builtin.setup: | 
|  | 18 | +    gather_subset: distribution | 
| 26 | 19 | 
 | 
| 27 |  | -- name: Assert that OS is supported for Cloudera Manager version | 
|  | 20 | +- name: Assert OS support for Cloudera Manager versions | 
| 28 | 21 |   ansible.builtin.assert: | 
| 29 | 22 |     that: | 
| 30 |  | -      - support_matrix | selectattr('manager_version', 'version', cloudera_manager_version, 'le') | length > 0 | 
| 31 |  | -    fail_msg: > | 
| 32 |  | -      Cloudera Manager version {{ cloudera_manager_version }} not supported for | 
| 33 |  | -      OS {{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}. | 
| 34 |  | -    quiet: true | 
|  | 23 | +      - supported_cms | | 
|  | 24 | +        selectattr('family', 'eq', cm_repo_supported_distribution_map[ansible_facts['distribution']] | default(ansible_facts['distribution'])) | | 
|  | 25 | +        selectattr('version', 'eq', ansible_facts['distribution_version']) | | 
|  | 26 | +        length > 0 | 
|  | 27 | +    fail_msg: "OS {{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }} not supported." | 
|  | 28 | +  vars: | 
|  | 29 | +    supported_cms: "{{ lookup('cloudera.exe.supported', 'operating_systems', product='cloudera_manager', version=cloudera_manager_version) }}" | 
| 35 | 30 | 
 | 
| 36 | 31 | - name: Load Cloudera Manager package repository variables for OS and CM version | 
| 37 | 32 |   ansible.builtin.include_vars: "{{ item }}" | 
|  | 
| 44 | 39 |     - "{{ ansible_facts['os_family'] }}.yml" | 
| 45 | 40 |     - "default.yml" | 
| 46 | 41 |   vars: | 
| 47 |  | -    cm_version: "{{ cloudera_manager_version | cloudera.exe.cm_version }}" | 
|  | 42 | +    cm_version: "{{ cloudera_manager_version | cloudera.exe.version }}" | 
| 48 | 43 | 
 | 
| 49 | 44 | - name: Configure Cloudera Manager package repository | 
| 50 | 45 |   ansible.builtin.include_tasks: | 
|  | 
0 commit comments