blob: 2f6348ef56f3ef3976f4dcd1144eac29606b4c40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
|