diff options
| author | Mustapha Lansana <Mustapha.Lansana@windriver.com> | 2014-07-30 19:32:37 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-09-26 09:09:21 -0400 |
| commit | 261f7f857503d7dcd7dcdc4c36aeff1b57194f9b (patch) | |
| tree | 62bfe5adcc46479e1d864cfa79635060a0e7cdb4 /meta-openstack/recipes-support/deploychef/files/service-shutdown | |
| parent | 48bd378fda4db37b519742bdcf98b6a48f83b594 (diff) | |
| download | meta-cloud-services-261f7f857503d7dcd7dcdc4c36aeff1b57194f9b.tar.gz | |
deploychef: adaptation of deploychef to support openstackchef
The deploychef package has been adapted to implement the
run-time functionality required by decentralized openstackchef
class.
It does this by executing a script (deploychef) which instruct chef-solo
to recreate configuration files from all template files placed
at
/opt/deploychef/cookbooks/openstack/templates/default
by openstackchef class at build-time.
The deploychef init script run-level is lower than run-postinsts
script, which runs all openstack post-install scripts at first boot.
The deploychef script makes a call to run-chefsolo script,
which then creates openstack configuration files from all template
files mentioned above as directed by a recipe file.
This enables us to reconfigure an openstack image on first-boot,
thereby, updating the image with environment variables like IP address.
Like the template files above, there is a list of all default
variables used by the services in an openstack installation.
These variables, like the templates files above are created by
the openstackchef class and saved to a file under deploychef
directory at:
/opt/deploychef/cookbooks/openstack/attributes/default.rb
Whenever it's desired to reconfigure an openstack deployment
with an updated value of any of the variables in the attributes file
above, the script file run-deploychef should be executed to
reconfigure the stack as shown below.
cd /opt/deploychef
./run-deploychef
Signed-off-by: Mustapha Lansana <Mustapha.Lansana@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-support/deploychef/files/service-shutdown')
| -rw-r--r-- | meta-openstack/recipes-support/deploychef/files/service-shutdown | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/meta-openstack/recipes-support/deploychef/files/service-shutdown b/meta-openstack/recipes-support/deploychef/files/service-shutdown index b89f9fa..00b571f 100644 --- a/meta-openstack/recipes-support/deploychef/files/service-shutdown +++ b/meta-openstack/recipes-support/deploychef/files/service-shutdown | |||
| @@ -22,33 +22,20 @@ | |||
| 22 | # THE SOFTWARE. | 22 | # THE SOFTWARE. |
| 23 | # | 23 | # |
| 24 | # | 24 | # |
| 25 | INITD_DIR=/etc/init.d/ | 25 | source /opt/deploychef/deploychef-inc |
| 26 | services=$(cat %DEPLOYCHEF_ROOT_DIR%/shutdown-list) | ||
| 27 | for service in $services; do | ||
| 28 | service=$(echo $service | awk -F'K..' '{print $2}') | ||
| 29 | if [ -e $INITD_DIR$service ]; then | ||
| 30 | $INITD_DIR$service stop | ||
| 31 | sleep 1 | ||
| 32 | fi | ||
| 33 | done | ||
| 34 | 26 | ||
| 27 | make_log_dir | ||
| 28 | start_stop_services 'shutdown-list' | ||
| 35 | #Clean up swift installation and all stale files | 29 | #Clean up swift installation and all stale files |
| 36 | /etc/swift/swift_setup.sh clean | 30 | if [ -f /etc/swift/swift_setup.sh ]; then |
| 37 | 31 | /etc/swift/swift_setup.sh clean | |
| 38 | #Delete all the know data base entries | 32 | fi |
| 39 | databases="ceilometer cinder glance heat keystone nova ovs_neutron \ | 33 | #Now stop postgresql and delete database directory |
| 40 | postgres" | 34 | if [ -e ${INITD_DIR}/postgresql ]; then |
| 41 | for database in $databases; do | 35 | ${INITD_DIR}/postgresql stop |
| 42 | sudo -u postgres dropdb $database | 36 | killall postgres & |
| 43 | sleep 1 | 37 | wait |
| 44 | done | 38 | rm -rf /etc/postgresql & |
| 45 | 39 | wait | |
| 46 | #Now shutdown postgres and database directory | ||
| 47 | if [ -e ${INITD_DIR}postgresql ]; then | ||
| 48 | ${INITD_DIR}postgresql stop | ||
| 49 | killall postgres | ||
| 50 | sleep 1 | ||
| 51 | rm -rf /etc/postgresql | ||
| 52 | sleep 1 | ||
| 53 | fi | 40 | fi |
| 54 | 41 | ||
