| Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 1 | # ceph.sh - DevStack extras script to install Ceph | 
 | 2 |  | 
 | 3 | if is_service_enabled ceph; then | 
 | 4 |     if [[ "$1" == "source" ]]; then | 
 | 5 |         # Initial source | 
 | 6 |         source $TOP_DIR/lib/ceph | 
 | 7 |     elif [[ "$1" == "stack" && "$2" == "pre-install" ]]; then | 
 | 8 |         echo_summary "Installing Ceph" | 
 | 9 |         install_ceph | 
 | 10 |         echo_summary "Configuring Ceph" | 
 | 11 |         configure_ceph | 
 | 12 |         # NOTE (leseb): Do everything here because we need to have Ceph started before the main | 
 | 13 |         # OpenStack components. Ceph OSD must start here otherwise we can't upload any images. | 
 | 14 |         echo_summary "Initializing Ceph" | 
 | 15 |         init_ceph | 
 | 16 |         start_ceph | 
 | 17 |     elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then | 
 | 18 |         if is_service_enabled glance; then | 
 | 19 |             echo_summary "Configuring Glance for Ceph" | 
 | 20 |             configure_ceph_glance | 
 | 21 |         fi | 
 | 22 |         if is_service_enabled nova; then | 
 | 23 |             echo_summary "Configuring Nova for Ceph" | 
 | 24 |             configure_ceph_nova | 
 | 25 |         fi | 
 | 26 |         if is_service_enabled cinder; then | 
 | 27 |             echo_summary "Configuring Cinder for Ceph" | 
 | 28 |             configure_ceph_cinder | 
 | 29 |             # NOTE (leseb): the part below is a requirement from Cinder in order to attach volumes | 
 | 30 |             # so we should run the following within the if statement. | 
 | 31 |             echo_summary "Configuring libvirt secret" | 
 | 32 |             import_libvirt_secret_ceph | 
 | 33 |         fi | 
 | 34 |     fi | 
 | 35 |  | 
 | 36 |     if [[ "$1" == "unstack" ]]; then | 
 | 37 |         stop_ceph | 
 | 38 |         cleanup_ceph | 
 | 39 |     fi | 
 | 40 |  | 
 | 41 |     if [[ "$1" == "clean" ]]; then | 
 | 42 |         cleanup_ceph | 
 | 43 |     fi | 
 | 44 | fi |