]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-common: use yum_repository when adding the ceph_stable repo
authorAndrew Schoen <aschoen@redhat.com>
Fri, 17 Feb 2017 20:27:15 +0000 (14:27 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 21 Feb 2017 18:31:26 +0000 (12:31 -0600)
This gives us more flexibility than installing the ceph-release package
as we can easily use different mirrors. Also, I noticed an issue when
upgrading from jewel -> kraken as the ceph-release package for those
releases both have the same version number and yum doesn't know to
update anything.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/ceph-common/tasks/installs/redhat_ceph_repository.yml

index a90309653a7da66e9d290bee7dfb317cdd33c573..b0f285b3e7277e5dc73252df579ed8fbc405caf4 100644 (file)
@@ -6,19 +6,15 @@
   when: ceph_stable
 
 - name: add ceph stable repository
-  package:
-    name: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm"
+  yum_repository:
+    name: ceph_stable
+    description: Ceph Stable repo
+    gpgcheck: yes
     state: present
-  changed_when: false
+    gpgkey: "{{ ceph_stable_key }}"
+    baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/$basearch"
   when: ceph_stable
 
-- name: change download url to ceph mirror
-  replace:
-    name: /etc/yum.repos.d/ceph.repo
-    regexp: http://download.ceph.com
-    replace: "{{ ceph_mirror }}"
-  when: ceph_mirror != "http://download.ceph.com"
-
 # we must use curl instead of ansible's uri module because SNI support in
 # Python is only available in 2.7.9 and later, and most supported distributions
 # don't have that version, so a request to https fails.