2 - name: install ceph-common external package when ceph backend enabled
\r
8 when: enabled_backend == "ceph"
\r
10 - name: copy opensds ceph backend file if specify ceph backend
\r
12 src: ../../../group_vars/ceph/ceph.yaml
\r
13 dest: "{{ ceph_config_path }}"
\r
15 - name: check for ceph-ansible source code existed
\r
17 path: /opt/ceph-ansible
\r
19 register: cephansibleexisted
\r
21 - name: download ceph-ansible source code
\r
23 repo: https://github.com/ceph/ceph-ansible.git
\r
24 dest: /opt/ceph-ansible
\r
26 - cephansibleexisted.stat.exists is undefined or cephansibleexisted.stat.exists == false
\r
28 - name: copy ceph inventory host into ceph-ansible directory
\r
30 src: ../../../group_vars/ceph/ceph.hosts
\r
31 dest: /opt/ceph-ansible/ceph.hosts
\r
33 - name: copy ceph all.yml file into ceph-ansible group_vars directory
\r
35 src: ../../../group_vars/ceph/all.yml
\r
36 dest: /opt/ceph-ansible/group_vars/all.yml
\r
38 - name: copy ceph osds.yml file into ceph-ansible group_vars directory
\r
40 src: ../../../group_vars/ceph/osds.yml
\r
41 dest: /opt/ceph-ansible/group_vars/osds.yml
\r
43 - name: copy site.yml.sample to site.yml in ceph-ansible
\r
45 src: /opt/ceph-ansible/site.yml.sample
\r
46 dest: /opt/ceph-ansible/site.yml
\r
48 - name: ping all hosts
\r
49 shell: ansible all -m ping -i ceph.hosts
\r
52 chdir: /opt/ceph-ansible
\r
54 - name: run ceph-ansible playbook
\r
55 shell: ansible-playbook site.yml -i ceph.hosts | tee /var/log/ceph_ansible.log
\r
58 chdir: /opt/ceph-ansible
\r
60 #- name: Check if ceph osd is running
\r
61 # shell: ps aux | grep ceph-osd | grep -v grep
\r
62 # ignore_errors: false
\r
63 # changed_when: false
\r
64 # register: service_ceph_osd_status
\r
66 - name: Check if ceph mon is running
\r
67 shell: ps aux | grep ceph-mon | grep -v grep
\r
68 ignore_errors: false
\r
70 register: service_ceph_mon_status
\r
72 - name: Create specified pools and initialize them with default pool size.
\r
73 shell: ceph osd pool create {{ item }} 100 && ceph osd pool set {{ item }} size 1
\r
76 with_items: "{{ ceph_pools }}"
\r
77 when: service_ceph_mon_status.rc == 0 # and service_ceph_osd_status.rc == 0
\r