Merge nbp installation into opensds ansible script
[stor4nfv.git] / ci / ansible / roles / osdsdock / scenarios / ceph.yml
index 2fa66b2..b844a29 100644 (file)
@@ -1,9 +1,17 @@
 ---\r
 - name: install ceph-common external package when ceph backend enabled\r
   apt:\r
-    name: ceph-common\r
+    name: "{{ item }}"\r
+    state: present\r
+  with_items:\r
+    - ceph-common\r
   when: enabled_backend == "ceph"\r
 \r
+- name: copy opensds ceph backend file if specify ceph backend\r
+  copy:\r
+    src: ../../../group_vars/ceph/ceph.yaml\r
+    dest: "{{ ceph_config_path }}"\r
+\r
 - name: check for ceph-ansible source code existed\r
   stat:\r
     path: /opt/ceph-ansible\r
     chdir: /opt/ceph-ansible\r
 \r
 - name: run ceph-ansible playbook\r
-  shell: ansible-playbook site.yml -i ceph.hosts\r
+  shell: ansible-playbook site.yml -i ceph.hosts | tee /var/log/ceph_ansible.log\r
   become: true\r
   args:\r
     chdir: /opt/ceph-ansible\r
 \r
-- name: Check if ceph osd is running\r
-  shell: ps aux | grep ceph-osd | grep -v grep\r
-  ignore_errors: false\r
-  changed_when: false\r
-  register: service_ceph_osd_status\r
+#- name: Check if ceph osd is running\r
+#  shell: ps aux | grep ceph-osd | grep -v grep\r
+#  ignore_errors: false\r
+#  changed_when: false\r
+#  register: service_ceph_osd_status\r
 \r
 - name: Check if ceph mon is running\r
   shell: ps aux | grep ceph-mon | grep -v grep\r
@@ -61,9 +69,9 @@
   changed_when: false\r
   register: service_ceph_mon_status\r
 \r
-- name: Create a pool and initialize it.\r
-  shell: ceph osd pool create {{ ceph_pool_name }} 100 && ceph osd pool set {{ ceph_pool_name }} size 1\r
+- name: Create specified pools and initialize them with default pool size.\r
+  shell: ceph osd pool create {{ item }} 100 && ceph osd pool set {{ item }} size 1\r
   ignore_errors: yes\r
   changed_when: false\r
-  register: ceph_init_pool\r
-  when: service_ceph_mon_status.rc == 0 and service_ceph_osd_status.rc == 0
\ No newline at end of file
+  with_items: "{{ ceph_pools }}"\r
+  when: service_ceph_mon_status.rc == 0 # and service_ceph_osd_status.rc == 0\r