From 89a34d41727fc4e6636702412d181b6f842cfa77 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 17 Feb 2023 16:43:33 +0100 Subject: [PATCH] preflight: support IBM repositories installation This makes the preflight playbook support IBM repositories. Signed-off-by: Guillaume Abrioux (cherry picked from commit 8037884bedbf26b6709949e57fe8b99c7f1bd966) --- ceph_defaults/defaults/main.yml | 4 ++++ cephadm-preflight.yml | 38 ++++++++++++++++----------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/ceph_defaults/defaults/main.yml b/ceph_defaults/defaults/main.yml index 121eed6..d511f8c 100644 --- a/ceph_defaults/defaults/main.yml +++ b/ceph_defaults/defaults/main.yml @@ -3,8 +3,12 @@ ceph_origin: community ceph_dev_branch: main ceph_dev_sha1: latest ceph_rhcs_version: 5 +ceph_ibm_version: 5 ceph_mirror: https://download.ceph.com ceph_stable_key: https://download.ceph.com/keys/release.asc +ceph_community_repo_baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_release }}/el{{ ansible_facts['distribution_major_version'] }}/" +ceph_ibm_repo_baseurl: "https://public.dhe.ibm.com/ibmdl/export/pub/storage/ceph/{{ ceph_ibm_version }}/rhel{{ ansible_facts['distribution_major_version'] }}/" +ceph_ibm_key: https://public.dhe.ibm.com/ibmdl/export/pub/storage/ceph/5/rhel8/ibm-key.asc ceph_release: quincy upgrade_ceph_packages: false ceph_pkgs: diff --git a/cephadm-preflight.yml b/cephadm-preflight.yml index f0dbb34..fb429e1 100644 --- a/cephadm-preflight.yml +++ b/cephadm-preflight.yml @@ -49,41 +49,41 @@ - rhceph-4-osd-for-rhel-8-{{ ansible_facts['architecture'] }}-rpms when: ansible_facts['distribution_major_version'] | int == 8 + + # https://public.dhe.ibm.com/ibmdl/export/pub/storage/ceph/5/rhel8/$basearch/ - name: enable repo from download.ceph.com - when: ceph_origin == 'community' + when: ceph_origin in ['community', 'ibm'] block: + - name: set_fact _ceph_repo + set_fact: + _ceph_repos: + - name: ceph_stable + description: "{{ 'Ceph Stable repo' if ceph_origin == 'community' else 'IBM Ceph repo' }}" + rpm_key: "{{ ceph_stable_key if ceph_origin == 'community' else ceph_ibm_key }}" + baseurl: "{{ ceph_community_repo_baseurl if ceph_origin == 'community' else ceph_ibm_repo_baseurl }}" + - name: configure ceph community repository stable key rpm_key: - key: "{{ ceph_stable_key }}" + key: "{{ _ceph_repo.rpm_key }}" state: present register: result until: result is succeeded - - name: configure ceph community stable repository + - name: configure ceph stable repository yum_repository: name: ceph_stable - description: Ceph Stable $basearch repo - gpgcheck: yes - state: present - gpgkey: "{{ ceph_stable_key }}" - baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_release }}/el{{ ansible_facts['distribution_major_version'] }}/$basearch" - file: ceph_stable - priority: '2' - register: result - until: result is succeeded - - - name: configure ceph community stable noarch repository - yum_repository: - name: ceph_stable_noarch - description: Ceph Stable noarch repo + description: "{{ _ceph_repo.description }} - {{ item }}" gpgcheck: yes state: present - gpgkey: "{{ ceph_stable_key }}" - baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_release }}/el{{ ansible_facts['distribution_major_version'] }}/noarch" + gpgkey: "{{ _ceph_repo.rpm_key }}" + baseurl: "{{ _ceph_repo.baseurl }}/{{ item }}" file: ceph_stable priority: '2' register: result until: result is succeeded + loop: + - "$basearch" + - "noarch" - name: enable repo from shaman - dev when: ceph_origin == 'shaman'