Skip to content

Commit

Permalink
Merge pull request #45 from leonwanghui/fixer
Browse files Browse the repository at this point in the history
Fix some bugs when deploying ceph cluster using ansible
  • Loading branch information
leonwanghui authored Jun 29, 2018
2 parents 535bc1b + c1469a8 commit 837e302
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions ansible/roles/osdsdock/scenarios/ceph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,30 @@
args:
chdir: /opt/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 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
- 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 specified pools and initialize them with default pool size.
- name: configure profile and disable some features in ceph for kernel compatible.
shell: "{{ item }}"
become: true
ignore_errors: yes
with_items:
- ceph osd crush tunables hammer
- grep -q "^rbd default features" /etc/ceph/ceph.conf || sed -i '/\[global\]/arbd default features = 1' /etc/ceph/ceph.conf
when: service_ceph_mon_status.rc == 0 and service_ceph_osd_status.rc == 0

- name: create specified pools and initialize them with default pool size.
shell: ceph osd pool create {{ item }} 100 && ceph osd pool set {{ item }} size 1
ignore_errors: yes
changed_when: false
with_items: "{{ ceph_pools }}"
when: service_ceph_mon_status.rc == 0 # and service_ceph_osd_status.rc == 0
when: service_ceph_mon_status.rc == 0 and service_ceph_osd_status.rc == 0

0 comments on commit 837e302

Please sign in to comment.