From d0bef02d7dfff29fc99760cb75aa7a78ae68acca Mon Sep 17 00:00:00 2001 From: Mustapha Lansana Date: Thu, 25 Sep 2014 09:45:26 -0400 Subject: deploychef: use /etc/init.d/run-postinsts to execute scripts With changes made to the identity class, the postinstall scripts no longer register users and services with keystone. Instead, the registration is put inside the file /etc/keystone/service-user-setup by the postinstall scripts. Executing /etc/keystone/service-user-setup then registers the users and services with keystone through /etc/keystone/identity.sh. Therefore, executing just the postinstall scripts is not enough enough to properly bring up the stack. However, executing /etc/init.d/run-postinsts does both. In addition, we are executing scripts within run-deploy in the current shell environment so that the user can see all the updates to the databases on the terminal. Signed-off-by: Mustapha Lansana --- .../recipes-support/deploychef/files/run-deploychef | 6 +++--- .../recipes-support/deploychef/files/run-postinsts | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/meta-openstack/recipes-support/deploychef/files/run-deploychef b/meta-openstack/recipes-support/deploychef/files/run-deploychef index e8a8a57..4fd41d8 100644 --- a/meta-openstack/recipes-support/deploychef/files/run-deploychef +++ b/meta-openstack/recipes-support/deploychef/files/run-deploychef @@ -26,8 +26,8 @@ # the attributes variables change at run-time. # #Shutdown all registered services -. service-shutdown +. ./service-shutdown #Re-generate configuration files from template files -. run-openstackchef +. ./run-openstackchef #Run post-install script and then start services -. run-postinsts +. ./run-postinsts diff --git a/meta-openstack/recipes-support/deploychef/files/run-postinsts b/meta-openstack/recipes-support/deploychef/files/run-postinsts index 737012d..8380927 100644 --- a/meta-openstack/recipes-support/deploychef/files/run-postinsts +++ b/meta-openstack/recipes-support/deploychef/files/run-postinsts @@ -27,7 +27,21 @@ # source /opt/deploychef/deploychef-inc #Run postinsts scripts -execute_all_postinsts +#execute_all_postinsts +#The registration of tenants/user/services has moved from the postinstall +#scriptis to a single setup file; /etc/keystone/service-user-setup, which +#handles the registration through /etc/keystone/identity.sh script. +#Therefore, execute /etc/init.d/run-postinsts which in-turn runs this script. +if [ -f /etc/keystone/service-user-setup ]; then + #Remove stale tenants/users/services + rm -f /etc/keystone/service-user-setup +fi +if [ -e /etc/init.d/run-postinsts ]; then + echo "Running postinstall scripts" >> $LOG_FILE + sh -c /etc/init.d/run-postinsts +else + echo "EEROR: Tenants/users/services not registered with Keystone" >> $LOG_FILE +fi #Start all the modules specified in startup-list start_stop_services 'startup-list' #Restart cloud service cloud-init -- cgit v1.2.3-54-g00ecf