2 - name: install ceph-common external package when ceph backend enabled
5 when: enabled_backend == "ceph"
7 - name: copy opensds ceph backend file if specify ceph backend
9 src: ../../../group_vars/ceph/ceph.yaml
10 dest: "{{ ceph_config_path }}"
12 - name: check for ceph-ansible source code existed
14 path: /opt/ceph-ansible
16 register: cephansibleexisted
18 - name: download ceph-ansible source code
20 repo: https://github.com/ceph/ceph-ansible.git
21 dest: /opt/ceph-ansible
23 - cephansibleexisted.stat.exists is undefined or cephansibleexisted.stat.exists == false
25 - name: copy ceph inventory host into ceph-ansible directory
27 src: ../../../group_vars/ceph/ceph.hosts
28 dest: /opt/ceph-ansible/ceph.hosts
30 - name: copy ceph all.yml file into ceph-ansible group_vars directory
32 src: ../../../group_vars/ceph/all.yml
33 dest: /opt/ceph-ansible/group_vars/all.yml
35 - name: copy ceph osds.yml file into ceph-ansible group_vars directory
37 src: ../../../group_vars/ceph/osds.yml
38 dest: /opt/ceph-ansible/group_vars/osds.yml
40 - name: copy site.yml.sample to site.yml in ceph-ansible
42 src: /opt/ceph-ansible/site.yml.sample
43 dest: /opt/ceph-ansible/site.yml
45 - name: ping all hosts
46 shell: ansible all -m ping -i ceph.hosts
49 chdir: /opt/ceph-ansible
51 - name: run ceph-ansible playbook
52 shell: ansible-playbook site.yml -i ceph.hosts
55 chdir: /opt/ceph-ansible
57 - name: Check if ceph osd is running
58 shell: ps aux | grep ceph-osd | grep -v grep
61 register: service_ceph_osd_status
63 - name: Check if ceph mon is running
64 shell: ps aux | grep ceph-mon | grep -v grep
67 register: service_ceph_mon_status
69 - name: Create a pool and initialize it.
70 shell: ceph osd pool create {{ ceph_pool_name }} 100 && ceph osd pool set {{ ceph_pool_name }} size 1
73 register: ceph_init_pool
74 when: service_ceph_mon_status.rc == 0 and service_ceph_osd_status.rc == 0