]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Speed up repository check
authorleseb <seb@redhat.com>
Mon, 6 Jul 2015 15:14:07 +0000 (17:14 +0200)
committerleseb <seb@redhat.com>
Mon, 6 Jul 2015 15:29:25 +0000 (17:29 +0200)
Even if the subcription command is indempotent it takes around 15/16sec
to get it done. Where with the simple yum check we lower down this to
3sec.

Signed-off-by: leseb <seb@redhat.com>
roles/ceph-common/tasks/prerequisite_rh_storage_cdn_install.yml

index 52f09f8147b63e72f0b70095cc48fa087e7abd2c..62c1cc3ab4732319019b157f4c4d89ac374bf2d0 100644 (file)
@@ -4,17 +4,41 @@
   register: subscription
   changed_when: false
 
+- name: check if the red hat storage monitor repo is already present
+  shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-mon-rpms
+  changed_when: false
+  register: rh_storage_mon_repo
+  when: mon_group_name in group_names
+
 - name: enable red hat storage monitor repository
   command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-mon-rpms
   changed_when: false
-  when: mon_group_name in group_names
+  when:
+    mon_group_name in group_names and
+    rh_storage_mon_repo.rc != 0
+
+- name: check if the red hat storage osd repo is already present
+  shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-mon-rpms
+  changed_when: false
+  register: rh_storage_osd_repo
+  when: osd_group_name in group_names
 
 - name: enable red hat storage osd repository
   command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-osd-rpms
   changed_when: false
-  when: osd_group_name in group_names
+  when:
+    osd_group_name in group_names and
+    rh_storage_osd_repo.rc != 0
+
+- name: check if the red hat storage rados gateway repo is already present
+  shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-mon-rpms
+  changed_when: false
+  register: rh_storage_rgw_repo
+  when: rgw_group_name in group_names
 
 - name: enable red hat storage rados gateway repository
   command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-tools-rpms
   changed_when: false
-  when: rgw_group_name in group_names
+  when:
+    rgw_group_name in group_names and
+    rh_storage_rgw_repo.rc != 0