split ceph into small size roles with specific purpose 81/3681/1
authorgrakiss <grakiss.wanglei@huawei.com>
Fri, 27 Nov 2015 02:54:43 +0000 (10:54 +0800)
committergrakiss <grakiss.wanglei@huawei.com>
Fri, 27 Nov 2015 02:54:43 +0000 (10:54 +0800)
JIRA: COMPASS-152
  - add ceph_adm ceph_mon ceph_osd

Signed-off-by: grakiss <grakiss.wanglei@huawei.com>
deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_install_Debian.yml
deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_install_RedHat.yml
deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_setup_env.yml
deploy/conf/virtual_cluster.yml

index d3cec00..58774e4 100644 (file)
@@ -56,7 +56,7 @@
   roles:
     - ext-network
 
-- hosts: ceph
+- hosts: ceph_adm
   remote_user: root
   sudo: True
   roles:
index 744120b..7c9545e 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - name: create ceph cluster
-  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy new {{ controller_nodes.stdout_lines[0] }}
+  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy new {{ mon_nodes.stdout_lines[0] }}
   tags:
     - create_ceph_cluster
 
 - name: copy create_osd.sh to other nodes
   shell: scp -o StrictHostKeyChecking=no ~/create_osd.sh {{ item }}:~/
   with_items:
-    - "{{ groups['compute'] }}"
+    - "{{ groups['ceph_osd'] }}"
   tags:
     - create_osd
 
 - name: create osd
   shell: ssh -o StrictHostKeyChecking=no -t {{ item }} "~/create_osd.sh"
   with_items:
-    - "{{ groups['compute'] }}"
+    - "{{ groups['ceph_osd'] }}"
   tags:
     - create_osd
 
 - name: prepare create osd
   shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd prepare {{ item }}:/var/local/osd
   with_items:
-    - "{{ groups['compute'] }}"
+    - "{{ groups['ceph_osd'] }}"
   tags:
     - create_osd
 
@@ -47,7 +47,7 @@
 - name: activate osd
   shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd activate {{ item }}:/var/local/osd && ceph-deploy osd activate {{ item }}:/var/local/osd
   with_items:
-    - "{{ groups['compute'] }}"
+    - "{{ groups['ceph_osd'] }}"
   tags:
     - create_osd
     - activate_osd
index 385c757..d907170 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - name: create ceph cluster
-  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy new {{ controller_nodes.stdout_lines[0] }}
+  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy new {{ mon_nodes.stdout_lines[0] }}
   tags:
     - create_ceph_cluster
 
 - name: copy create_osd.sh to other nodes
   shell: scp -o StrictHostKeyChecking=no ~/create_osd.sh {{ item }}:~/
   with_items:
-    - "{{ groups['compute'] }}"
+    - "{{ groups['ceph_osd'] }}"
   tags:
     - create_osd
 
 - name: create osd
   shell: ssh -o StrictHostKeyChecking=no -t {{ item }} "~/create_osd.sh"
   with_items:
-    - "{{ groups['compute'] }}"
+    - "{{ groups['ceph_osd'] }}"
   tags:
     - create_osd
 
 - name: prepare create osd
   shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd prepare {{ item }}:/var/local/osd
   with_items:
-    - "{{ groups['compute'] }}"
+    - "{{ groups['ceph_osd'] }}"
   tags:
     - create_osd
 
@@ -47,7 +47,7 @@
 - name: activate osd
   shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd activate {{ item }}:/var/local/osd
   with_items:
-    - "{{ groups['compute'] }}"
+    - "{{ groups['ceph_osd'] }}"
   tags:
     - create_osd
     - activate_osd
index f89e2c6..0f3ad60 100644 (file)
     - create_ceph_cluster
     - ceph_install
 
+- name: clear ceph_mon_nodes
+  file: path=ceph_mon_nodes state=absent
+  tags:
+    - create_ceph_cluster
+    - ceph_install
 
 - name: echo hosts name to file
   shell: echo -n "{{ item }} " >> cluster_hosts_name
     - echo_hosts
     - ceph_install
 
+- name: echo ceph-mon name to file
+  shell: echo -n "{{ item }} " >> ceph_mon_nodes
+  with_items:
+    - "{{ groups['ceph_mon'] }}"
+  tags:
+    - create_ceph_cluster
+    - ceph_install
+
+- name: register ceph-mon nodes
+  shell: cat ceph_mon_nodes
+  register: mon_nodes
+  tags:
+    - create_ceph_cluster
+    - echo_hosts
+    - ceph_install
 
 - name: gen clean ceph script
   template: src=clean_ceph.j2 dest=~/clean_ceph.sh mode=0777
index 6ee8c95..aa2a1b3 100644 (file)
@@ -6,22 +6,27 @@ hosts:
     roles:
       - controller
       - ha
-      - ceph
+      - ceph-adm
+      - ceph-mon
 
   - name: host2
     roles:
       - controller
       - ha
+      - ceph-mon
 
   - name: host3
     roles:
       - controller
       - ha
+      - ceph-mon
 
   - name: host4
     roles:
       - compute
+      - ceph-osd
 
   - name: host5
     roles:
       - compute
+      - ceph-osd