summaryrefslogtreecommitdiffstats
path: root/ci/ansible/roles/osdsdock/scenarios/ceph.yml
diff options
context:
space:
mode:
authorleonwang <wanghui71@huawei.com>2018-01-10 03:44:46 +0000
committerleonwang <wanghui71@huawei.com>2018-01-10 08:43:38 +0000
commit64df7bc3bc70d49153409436b411fb327691a4d5 (patch)
treec078dda45831938f0268e66f774390b4079309c7 /ci/ansible/roles/osdsdock/scenarios/ceph.yml
parent0786fde30eba926b097617dea9ca4683ac2fa1b7 (diff)
Push zealand version of opensds ansible as base-code of Stor4NFV
As we discussed on last meeting, the installer script of stor4nfv will be based on opensds ansible, so in this patch I download the first release (zealand) of opensds code and push the ansible script into stor4nfv repo so that we don't need to modify opensds code. Please be free to ask if you have any question. Change-Id: I7b50729977b195fa64e8d9a09f415d9f3329d71f Signed-off-by: leonwang <wanghui71@huawei.com>
Diffstat (limited to 'ci/ansible/roles/osdsdock/scenarios/ceph.yml')
-rw-r--r--ci/ansible/roles/osdsdock/scenarios/ceph.yml69
1 files changed, 69 insertions, 0 deletions
diff --git a/ci/ansible/roles/osdsdock/scenarios/ceph.yml b/ci/ansible/roles/osdsdock/scenarios/ceph.yml
new file mode 100644
index 0000000..2f6348e
--- /dev/null
+++ b/ci/ansible/roles/osdsdock/scenarios/ceph.yml
@@ -0,0 +1,69 @@
+---
+- name: install ceph-common external package when ceph backend enabled
+ apt:
+ name: ceph-common
+ when: enabled_backend == "ceph"
+
+- name: check for ceph-ansible source code existed
+ stat:
+ path: /tmp/ceph-ansible
+ ignore_errors: yes
+ register: cephansibleexisted
+
+- name: download ceph-ansible source code
+ git:
+ repo: https://github.com/ceph/ceph-ansible.git
+ dest: /tmp/ceph-ansible
+ when:
+ - cephansibleexisted.stat.exists is undefined or cephansibleexisted.stat.exists == false
+
+- name: copy ceph inventory host into ceph-ansible directory
+ copy:
+ src: ../../../group_vars/ceph/ceph.hosts
+ dest: /tmp/ceph-ansible/ceph.hosts
+
+- name: copy ceph all.yml file into ceph-ansible group_vars directory
+ copy:
+ src: ../../../group_vars/ceph/all.yml
+ dest: /tmp/ceph-ansible/group_vars/all.yml
+
+- name: copy ceph osds.yml file into ceph-ansible group_vars directory
+ copy:
+ src: ../../../group_vars/ceph/osds.yml
+ dest: /tmp/ceph-ansible/group_vars/osds.yml
+
+- name: copy site.yml.sample to site.yml in ceph-ansible
+ copy:
+ src: /tmp/ceph-ansible/site.yml.sample
+ dest: /tmp/ceph-ansible/site.yml
+
+- name: ping all hosts
+ shell: ansible all -m ping -i ceph.hosts
+ become: true
+ args:
+ chdir: /tmp/ceph-ansible
+
+- name: run ceph-ansible playbook
+ shell: ansible-playbook site.yml -i ceph.hosts
+ become: true
+ args:
+ chdir: /tmp/ceph-ansible
+
+- name: Check if ceph osd is running
+ shell: ps aux | grep ceph-osd | grep -v grep
+ ignore_errors: false
+ changed_when: false
+ register: service_ceph_osd_status
+
+- name: Check if ceph mon is running
+ shell: ps aux | grep ceph-mon | grep -v grep
+ ignore_errors: false
+ changed_when: false
+ register: service_ceph_mon_status
+
+- name: Create a pool and initialize it.
+ shell: ceph osd pool create {{ ceph_pool_name }} 100 && ceph osd pool set {{ ceph_pool_name }} size 1
+ ignore_errors: yes
+ changed_when: false
+ register: ceph_init_pool
+ when: service_ceph_mon_status.rc == 0 and service_ceph_osd_status.rc == 0 \ No newline at end of file