2015-07-15 12:29:03 +05:30
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# devstack/plugin.sh
|
|
|
|
# Triggers glusterfs specific functions to install and configure GlusterFS
|
2015-01-19 12:43:03 +05:30
|
|
|
|
|
|
|
# Dependencies:
|
|
|
|
#
|
|
|
|
# - ``functions`` file
|
2015-07-15 12:29:03 +05:30
|
|
|
# - ``DATA_DIR`` must be defined
|
2015-01-19 12:43:03 +05:30
|
|
|
|
|
|
|
# ``stack.sh`` calls the entry points in this order:
|
|
|
|
#
|
|
|
|
# - install_glusterfs
|
|
|
|
# - start_glusterfs
|
2015-07-15 12:29:03 +05:30
|
|
|
# - configure_cinder_backend_glusterfs
|
2015-08-19 12:32:37 +05:30
|
|
|
# - configure_cinder_backup_backend_glusterfs
|
2015-08-06 13:24:43 +05:30
|
|
|
# - configure_glance_backend_glusterfs
|
2015-08-06 13:25:44 +05:30
|
|
|
# - configure_nova_backend_glusterfs
|
2015-08-15 11:48:20 +05:30
|
|
|
# - configure_manila_backend_glusterfs
|
2015-01-19 12:43:03 +05:30
|
|
|
# - stop_glusterfs
|
|
|
|
# - cleanup_glusterfs
|
|
|
|
|
|
|
|
if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
|
2015-10-19 00:44:17 +05:30
|
|
|
echo_summary "Installing GlusterFS 3.7"
|
|
|
|
install_glusterfs 3.7
|
2015-08-06 13:24:43 +05:30
|
|
|
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
2015-10-19 00:44:17 +05:30
|
|
|
if is_service_enabled c-bak && [[ "$CONFIGURE_GLUSTERFS_CINDER_BACKUP" == "True" ]]; then
|
2015-08-19 12:32:37 +05:30
|
|
|
echo_summary "Configuring GlusterFS as a backend for Cinder backup driver"
|
|
|
|
configure_cinder_backup_backend_glusterfs
|
|
|
|
fi
|
2015-08-06 13:24:43 +05:30
|
|
|
if is_service_enabled glance && [[ "$CONFIGURE_GLUSTERFS_GLANCE" == "True" ]]; then
|
|
|
|
echo_summary "Configuring GlusterFS as a backend for Glance"
|
|
|
|
configure_glance_backend_glusterfs
|
|
|
|
fi
|
2015-08-06 13:25:44 +05:30
|
|
|
if is_service_enabled nova && [[ "$CONFIGURE_GLUSTERFS_NOVA" == "True" ]]; then
|
|
|
|
echo_summary "Configuring GlusterFS as a backend for Nova"
|
|
|
|
configure_nova_backend_glusterfs
|
|
|
|
fi
|
2015-08-15 11:48:20 +05:30
|
|
|
if is_service_enabled manila && [[ "$CONFIGURE_GLUSTERFS_MANILA" == "True" ]]; then
|
|
|
|
echo_summary "Configuring GlusterFS as a backend for Manila"
|
|
|
|
configure_manila_backend_glusterfs
|
|
|
|
fi
|
2015-08-19 16:29:07 +05:30
|
|
|
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
|
|
|
# Changing file permissions of glusterfs logs.
|
|
|
|
# This avoids creation of zero sized glusterfs log files while running CI job (Bug: 1455951).
|
|
|
|
sudo chmod 755 -R /var/log/glusterfs/
|
2015-01-19 12:43:03 +05:30
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$1" == "unstack" ]]; then
|
|
|
|
cleanup_glusterfs
|
|
|
|
stop_glusterfs
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$1" == "clean" ]]; then
|
|
|
|
cleanup_glusterfs
|
|
|
|
fi
|
|
|
|
|
|
|
|
## Local variables:
|
|
|
|
## mode: shell-script
|
|
|
|
## End:
|