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/run-deploychef | |
| 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/run-deploychef')
| -rw-r--r-- | meta-openstack/recipes-support/deploychef/files/run-deploychef | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/meta-openstack/recipes-support/deploychef/files/run-deploychef b/meta-openstack/recipes-support/deploychef/files/run-deploychef index 03e8807..e8a8a57 100644 --- a/meta-openstack/recipes-support/deploychef/files/run-deploychef +++ b/meta-openstack/recipes-support/deploychef/files/run-deploychef | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | # run-chefsolo | 2 | # run-deploychef |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2014 Wind River Systems, Inc. | 4 | # Copyright (c) 2014 Wind River Systems, Inc. |
| 5 | # | 5 | # |
| @@ -22,16 +22,12 @@ | |||
| 22 | # THE SOFTWARE. | 22 | # THE SOFTWARE. |
| 23 | # | 23 | # |
| 24 | # | 24 | # |
| 25 | # This file is the main file that the install will call in order to reconfig | 25 | # This file is the main script file that reconfigures the stack when any of |
| 26 | # and Openstack node | 26 | # the attributes variables change at run-time. |
| 27 | # bash run-chefsolo | ||
| 28 | # | 27 | # |
| 29 | # | 28 | #Shutdown all registered services |
| 30 | #Shutdown all openstack modules | 29 | . service-shutdown |
| 31 | bash service-shutdown | 30 | #Re-generate configuration files from template files |
| 32 | #Use chefsolo to bake our recipe and generate configuration files/scripts | 31 | . run-openstackchef |
| 33 | chef-solo -f -c config.rb -j attributes.json | 32 | #Run post-install script and then start services |
| 34 | #Workaround to force the files to be copied from postinsts dir | 33 | . run-postinsts |
| 35 | chef-solo -f -c config.rb -j attributes.json | ||
| 36 | #Restart services | ||
| 37 | bash run-postinsts /etc/%POSTINSTS_DIR%/ | ||
