]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
add ceph_mirror variable 1290/head
authorShengjing Zhu <zsj950618@gmail.com>
Wed, 8 Feb 2017 03:41:48 +0000 (11:41 +0800)
committerShengjing Zhu <zsj950618@gmail.com>
Wed, 8 Feb 2017 05:13:31 +0000 (13:13 +0800)
Closes: #1282
Signed-off-by: Shengjing Zhu <zsj950618@gmail.com>
group_vars/all.yml.sample
roles/ceph-common/defaults/main.yml
roles/ceph-common/tasks/installs/redhat_ceph_repository.yml

index 590f2c2ba9e74972e0d9ee0be77eaad1637c0e09..375583adbbde56f34bfabdd1610cbcb6acdb4888 100644 (file)
@@ -114,9 +114,10 @@ dummy:
 
 # COMMUNITY VERSION
 #ceph_stable: false # use ceph stable branch
+#ceph_mirror: http://download.ceph.com
 #ceph_stable_key: https://download.ceph.com/keys/release.asc
 #ceph_stable_release: jewel # ceph stable release
-#ceph_stable_repo: "http://download.ceph.com/debian-{{ ceph_stable_release }}"
+#ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}"
 
 ######################################
 # Releases name to number dictionary #
index 7de9e9d836ea44da22faa07bdfe95c41a59ee5bd..e6dddb528260bde114f5e32e8977bc6a13dbca7a 100644 (file)
@@ -106,9 +106,10 @@ ceph_use_distro_backports: false # DEBIAN ONLY
 
 # COMMUNITY VERSION
 ceph_stable: false # use ceph stable branch
+ceph_mirror: http://download.ceph.com
 ceph_stable_key: https://download.ceph.com/keys/release.asc
 ceph_stable_release: jewel # ceph stable release
-ceph_stable_repo: "http://download.ceph.com/debian-{{ ceph_stable_release }}"
+ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}"
 
 ######################################
 # Releases name to number dictionary #
index 94a59604e536d4c9e7a19f2a4deb48ba3213b3ef..a90309653a7da66e9d290bee7dfb317cdd33c573 100644 (file)
@@ -7,11 +7,18 @@
 
 - name: add ceph stable repository
   package:
-    name: http://download.ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm
+    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"
     state: present
   changed_when: false
   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.