From 567e90cd2ee90792ce04bfd7f3f44e3f0bccc546 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Mon, 21 Oct 2019 10:32:55 -0400 Subject: [PATCH] ceph-iscsi: add ceph-iscsi stable repositories This commit adds the support of the ceph-iscsi stable repository when use ceph_repository community instead of always using the devel repositories. We're still using the devel repositories for rtslib and tcmu-runner in both cases (dev and community). Signed-off-by: Dimitri Savineau (cherry picked from commit f2cb937193f96e9dc94c3d178fd2ea4cdd5bf895) --- .../tasks/non-container/prerequisites.yml | 49 +++++++++---------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml b/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml index 80694f315..c1a287069 100644 --- a/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml +++ b/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml @@ -24,45 +24,40 @@ - ceph-iscsi-config when: not use_new_ceph_iscsi | bool - - name: set_fact ceph_iscsi_repos - set_fact: - ceph_iscsi_repos: "{{ common_repos + iscsi_base }}" - - - name: set_fact ceph_iscsi_pkgs - set_fact: - ceph_iscsi_pkgs: "{{ common_pkgs + iscsi_base }}" - - name: when ceph_iscsi_config_dev is true when: - ceph_origin == 'repository' - - ceph_repository == 'dev' + - ceph_repository in ['dev', 'community'] - ceph_iscsi_config_dev | bool block: - - name: fetch ceph-iscsi development repository - uri: - url: https://shaman.ceph.com/api/repos/{{ item }}/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo - return_content: yes - register: ceph_iscsi_config_dev_yum_repo - with_items: "{{ ceph_iscsi_repos }}" + - name: ceph-iscsi dependency repositories + get_url: + url: 'https://shaman.ceph.com/api/repos/{{ item }}/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo' + dest: '/etc/yum.repos.d/{{ item }}-dev.repo' + force: true + with_items: "{{ common_repos }}" + + - name: ceph-iscsi development repository + get_url: + url: 'https://shaman.ceph.com/api/repos/{{ item }}/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo' + dest: '/etc/yum.repos.d/{{ item }}-dev.repo' + force: true + with_items: '{{ iscsi_base }}' + when: ceph_repository == 'dev' - - name: configure ceph-iscsi-config development repository - copy: - content: "{{ item.0.content }}" - dest: "/etc/yum.repos.d/{{ item.1 }}-dev.repo" - owner: root - group: root - backup: yes - with_together: - - "{{ ceph_iscsi_config_dev_yum_repo.results }}" - - "{{ ceph_iscsi_repos }}" + - name: ceph-iscsi stable repository + get_url: + url: 'https://download.ceph.com/ceph-iscsi/{{ "3" if use_new_ceph_iscsi | bool else "2" }}/rpm/el{{ ansible_distribution_major_version }}/ceph-iscsi.repo' + dest: /etc/yum.repos.d/ceph-iscsi.repo + force: true + when: ceph_repository == 'community' - name: install ceph iscsi package package: - name: "{{ item }}" + name: "{{ common_pkgs + iscsi_base }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" register: result until: result is succeeded - with_items: "{{ ceph_iscsi_pkgs }}" - name: check the status of the target.service override stat: -- 2.39.5