Merge pull request #66 from leseb/wip-maintenance

Add maintenance playbook
pull/67/head
Leseb 2014-04-09 17:53:55 +02:00
commit 74eb9eaa04
2 changed files with 41 additions and 11 deletions

22
hosts
View File

@ -5,19 +5,19 @@
## Common setup example
#
[mons]
ceph-mon0:2222
ceph-mon1:2200
ceph-mon2:2201
ceph-mon0:2200
ceph-mon1:2201
ceph-mon2:2202
[osds]
ceph-osd0:2202
ceph-osd1:2203
ceph-osd2:2204
ceph-osd0:2203
ceph-osd1:2204
ceph-osd2:2205
[mdss]
ceph-osd0:2202
ceph-osd1:2203
ceph-osd2:2204
[rgws]
ceph-rgw:2205
ceph-osd0:2203
ceph-osd1:2204
ceph-osd2:2205
#[rgws]
#ceph-rgw:2200
# Colocation setup example
#[mons]

30
maintenance.yml 100644
View File

@ -0,0 +1,30 @@
---
# This playbook was made to automate Ceph servers maintenance
# Typical use case: hardware change
# By running this playbook you will set the 'noout' flag on your
# cluster, which means that OSD **can't** be marked as out
# of the CRUSH map, but they will be marked as down.
# Basically we tell the cluster to don't move any data since
# the operation won't last for too long.
- hosts: <your_host>
gather_facts: False
tasks:
- name: Set the noout flag
command: ceph osd set noout
delegate_to: <your_monitor>
- name: Turn off the server
command: poweroff
- name: Wait for the server to go down
local_action: wait_for host=<your_host> port=22 state=stopped
- name: Wait for the server to come up
local_action: wait_for host=<your_host port=22 delay=10 timeout=3600
- name: Unset the noout flag
command: ceph osd unset noout
delegate_to: <your_monitor>