2 - name: install ceph-common external package when ceph backend enabled
\r
5 when: enabled_backend == "ceph"
\r
7 - name: check for ceph-ansible source code existed
\r
9 path: /tmp/ceph-ansible
\r
11 register: cephansibleexisted
\r
13 - name: download ceph-ansible source code
\r
15 repo: https://github.com/ceph/ceph-ansible.git
\r
16 dest: /tmp/ceph-ansible
\r
18 - cephansibleexisted.stat.exists is undefined or cephansibleexisted.stat.exists == false
\r
20 - name: copy ceph inventory host into ceph-ansible directory
\r
22 src: ../../../group_vars/ceph/ceph.hosts
\r
23 dest: /tmp/ceph-ansible/ceph.hosts
\r
25 - name: copy ceph all.yml file into ceph-ansible group_vars directory
\r
27 src: ../../../group_vars/ceph/all.yml
\r
28 dest: /tmp/ceph-ansible/group_vars/all.yml
\r
30 - name: copy ceph osds.yml file into ceph-ansible group_vars directory
\r
32 src: ../../../group_vars/ceph/osds.yml
\r
33 dest: /tmp/ceph-ansible/group_vars/osds.yml
\r
35 - name: copy site.yml.sample to site.yml in ceph-ansible
\r
37 src: /tmp/ceph-ansible/site.yml.sample
\r
38 dest: /tmp/ceph-ansible/site.yml
\r
40 - name: ping all hosts
\r
41 shell: ansible all -m ping -i ceph.hosts
\r
44 chdir: /tmp/ceph-ansible
\r
46 - name: run ceph-ansible playbook
\r
47 shell: ansible-playbook site.yml -i ceph.hosts
\r
50 chdir: /tmp/ceph-ansible
\r
52 - name: Check if ceph osd is running
\r
53 shell: ps aux | grep ceph-osd | grep -v grep
\r
54 ignore_errors: false
\r
56 register: service_ceph_osd_status
\r
58 - name: Check if ceph mon is running
\r
59 shell: ps aux | grep ceph-mon | grep -v grep
\r
60 ignore_errors: false
\r
62 register: service_ceph_mon_status
\r
64 - name: Create a pool and initialize it.
\r
65 shell: ceph osd pool create {{ ceph_pool_name }} 100 && ceph osd pool set {{ ceph_pool_name }} size 1
\r
68 register: ceph_init_pool
\r
69 when: service_ceph_mon_status.rc == 0 and service_ceph_osd_status.rc == 0