diff options
| author | Mark Asselstine <mark.asselstine@windriver.com> | 2017-01-09 10:04:10 -0500 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-01-09 12:23:58 -0500 |
| commit | 0d6067258d09fdd47c95828e5e0e9b0f9987a529 (patch) | |
| tree | dbce7395b11e577bbcd633fa0daeae24697df42e /meta-openstack | |
| parent | 96dd0da3edc2f56de99d84ef96effdbf366a3041 (diff) | |
| download | meta-cloud-services-0d6067258d09fdd47c95828e5e0e9b0f9987a529.tar.gz | |
chef: remove the use of chef
The use of chef was never complete, had isses with updating binary
database files and had a cumbersome implementation. Since we are using
Ansible in meta-overc we are dropping the use of chef here and will
look to being at par with meta-overc by using Ansible if/when we get
time to look at runtime configuration in meta-cloud-services.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack')
22 files changed, 136 insertions, 1574 deletions
diff --git a/meta-openstack/Documentation/README.openstackchef b/meta-openstack/Documentation/README.openstackchef deleted file mode 100644 index 7ddf23a..0000000 --- a/meta-openstack/Documentation/README.openstackchef +++ /dev/null | |||
| @@ -1,219 +0,0 @@ | |||
| 1 | openstackchef.bbclass | ||
| 2 | ========= | ||
| 3 | When an openstack image is built for a CONTROLLER, COMPUTE or allinone, | ||
| 4 | there are build-time variables that are hard-coded into the image. | ||
| 5 | These hardcoded variables need to be provided up front at | ||
| 6 | build time and cannot be changed easily at run-time. | ||
| 7 | What this means is that an image built for a specific deployment | ||
| 8 | environment cannot be easily deployed to another environment. | ||
| 9 | |||
| 10 | Openstackchef class enables openstack related services like, nova, postgresql, | ||
| 11 | neutron, etc to be re-configured at run-time. This means that if all the | ||
| 12 | services of an openstack installation inherits the openstackchef class, | ||
| 13 | openstackchef can successfully re-configure an openstack installation. | ||
| 14 | |||
| 15 | For example, at build time, many of the openstack services need to know ahead of | ||
| 16 | time, the IP address of the node on which CONTROLLER and COMPUTE will be deployed. | ||
| 17 | Once this IP address is built into the image, it cannot be changed at runtime. | ||
| 18 | In other words, if you build a CONTROLLER image for a machine with IP address | ||
| 19 | of 192.168.7.2, you cannot use that image on a machine with a different IP address. | ||
| 20 | |||
| 21 | This is very restrictive, since it does not allow the re-use of CONTROLLER/COMPUTE | ||
| 22 | images. | ||
| 23 | |||
| 24 | Openstackchef.bbclass facilitates the reuse of openstack images across multiple | ||
| 25 | machines. It does this by providing a mechanism for openstack related services | ||
| 26 | to register all configuration files that have run-time dependent variables like IP | ||
| 27 | address in them. | ||
| 28 | |||
| 29 | By inheriting openstackchef, and registering these configuration files | ||
| 30 | with openstackchef, the services are no longer tied to a specific | ||
| 31 | run-time environment. This is because, openstackchef makes it possible | ||
| 32 | for the registered configuration files to be recreated at run-time when | ||
| 33 | any of the environment variables changes. | ||
| 34 | |||
| 35 | The configuration files are registered with openstackchef by assigning | ||
| 36 | them to the variable CHEF_SERVICES_CONF_FILES in the recipe file. | ||
| 37 | |||
| 38 | See example below for barbican: | ||
| 39 | |||
| 40 | CHEF_SERVICES_CONF_FILES :="\ | ||
| 41 | ${sysconfdir}/${SRCNAME}/vassals/barbican-api.ini \ | ||
| 42 | ${sysconfdir}/${SRCNAME}/vassals/barbican-admin.ini \ | ||
| 43 | " | ||
| 44 | Openstackchef makes chef-solo templates out of | ||
| 45 | the registered files. At run-time, the deploychef package | ||
| 46 | makes a call to chef-solo, which in-turn use the template files | ||
| 47 | to recreate the registered configuration files. | ||
| 48 | |||
| 49 | Also see additional description in the openstackchef.bbclass header. | ||
| 50 | |||
| 51 | In addition to the simple placeholder/value substitution that is | ||
| 52 | done by the openstackchef class when creating the templates, | ||
| 53 | there are times when recipes need to do morethan a simple placeholder | ||
| 54 | substitution. For cases like these, openstackchef provides a mechanism for | ||
| 55 | the recipes to provide a special callback function. Openstackchef class | ||
| 56 | then makes a call to this special callback function to do any additional substitution. | ||
| 57 | |||
| 58 | The special shell callback function is registered with openstackchef by | ||
| 59 | assigning it to the variable CHEF_SERVICES_SPECIAL_FUNC. | ||
| 60 | |||
| 61 | The python-neutron recipe defines a special function and specifies it | ||
| 62 | as shown below. | ||
| 63 | |||
| 64 | CHEF_SERVICES_SPECIAL_FUNC := "deploychef_services_special_func" | ||
| 65 | |||
| 66 | Whenever the configuration files of any openstack service | ||
| 67 | changes, the service usually needs to reload the configuration file. | ||
| 68 | The list of scripts/priority levels responsible for restarting | ||
| 69 | the service when its configuration files change are assumed to | ||
| 70 | be provided by the following variables: | ||
| 71 | |||
| 72 | INITSCRIPT_PACKAGES | ||
| 73 | INITSCRIPT_NAME_x or INITSCRIPT_NAME | ||
| 74 | INITSCRIPT_PARAMS_x or INITSCRIPT_PARAMS | ||
| 75 | |||
| 76 | Here is an example of how python-barbican specifies these variables. | ||
| 77 | INITSCRIPT_PACKAGES = "${SRCNAME}" | ||
| 78 | INITSCRIPT_NAME_${SRCNAME} = "barbican-api" | ||
| 79 | INITSCRIPT_PARAMS_${SRCNAME} = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | ||
| 80 | |||
| 81 | In addition, there are services that might need to be restarted but does | ||
| 82 | not necessary have a configuration file. These services can also advertise | ||
| 83 | themselves to openstackchef with the above variables. | ||
| 84 | |||
| 85 | However, failure to provide appropriate values for the above variables after | ||
| 86 | registering a set of configuration files for an openstack service will | ||
| 87 | lead to the service not working properly. | ||
| 88 | |||
| 89 | Dependencies | ||
| 90 | ------------ | ||
| 91 | This class depends on the deploychef package for run-time implementation of | ||
| 92 | the class. However, the end user does not have to do anything about this | ||
| 93 | dependency, because it's resolved at build time and all deploychef package | ||
| 94 | files are automatically included on the rootfs of resulting image. | ||
| 95 | Openstackchef class creates the template files used by the deploychef package | ||
| 96 | to reconfigure an openstack node. | ||
| 97 | |||
| 98 | Deploychef executes chefsolo at run-time to recreate | ||
| 99 | the configuration files for openstack services from template files | ||
| 100 | created by openstackchef.bbclass at build time. | ||
| 101 | Chefsolo in turn uses the attributes and templates files to overwrite | ||
| 102 | the configuration files for services like neutron, nova, swift, etc.. | ||
| 103 | that had registered their configuration files with openstackchef class | ||
| 104 | at build time. | ||
| 105 | |||
| 106 | The base directory for the deploychef package is /opt/deploychef. | ||
| 107 | There are many files that goes into the re-configuration of an | ||
| 108 | openstack deployment, however, two are worth mentioning. | ||
| 109 | |||
| 110 | 1 . Default variables in openstack and the values they hold can be found in: | ||
| 111 | |||
| 112 | /opt/deploychef/cookbooks/openstack/attributes/default.rb | ||
| 113 | |||
| 114 | 2. A shell script file that should be executed to reconfigure the stack | ||
| 115 | on CONTROLLER, COMPUTE or allinone nodes. | ||
| 116 | |||
| 117 | /opt/deploychef/run-deploychef | ||
| 118 | |||
| 119 | The script file above should be executed when any of the run-time environment | ||
| 120 | variables found at /opt/deploychef/cookbooks/openstack/attributes/default.rb | ||
| 121 | is changed. | ||
| 122 | |||
| 123 | Run-time | ||
| 124 | ------- | ||
| 125 | Allinone: An allinone node boots-up with openstack re-configured and all services | ||
| 126 | accessible either through the command-line or through horizon. | ||
| 127 | |||
| 128 | CONTROLLER & COMPUTE: | ||
| 129 | Both CONTROLLER and COMPUTE nodes boots-up with their respective IP address | ||
| 130 | updated using the IP address on the interface of the machine on which they run. | ||
| 131 | |||
| 132 | For the CONTROLLER, you should be able to access horizon at this point. However, | ||
| 133 | both the CONTROLLER and COMPUTE are not aware of each other at this point. | ||
| 134 | |||
| 135 | For them to be made aware of each other, we need to inform the COMPUTE node of | ||
| 136 | the location of the CONTROLLER node, similarly, we need to inform the CONTROLLER | ||
| 137 | node about the location of the COMPUTE node. | ||
| 138 | |||
| 139 | In order to accomplish this on each node, edit IP address field in the file | ||
| 140 | |||
| 141 | /opt/deploychef/cookbooks/openstack/attributes/default.rb | ||
| 142 | |||
| 143 | On the CONTROLLER node, change COMPUTE's IP address to the IP address | ||
| 144 | of the machine on which you have openstack COMPUTE deployed. | ||
| 145 | |||
| 146 | Assuming COMPUTE's IP address was set to "192.168.7.4" at build-time and the | ||
| 147 | current IP address of the machine on which you have COMPUTE deployed is | ||
| 148 | "128.224.149.164". Then the line | ||
| 149 | |||
| 150 | default["COMPUTE_IP"] = "192.168.7.4" | ||
| 151 | |||
| 152 | should be changed to | ||
| 153 | |||
| 154 | default["COMPUTE_IP"] = "128.224.149.164" | ||
| 155 | |||
| 156 | |||
| 157 | Now cd into the base directory of deploychef and execute the script | ||
| 158 | 'run-deploychef'. | ||
| 159 | |||
| 160 | cd /opt/deploychef | ||
| 161 | ./run-deploychef | ||
| 162 | |||
| 163 | Note: It's important that you 'cd' into /opt/deploychef when running | ||
| 164 | run-deploychef script, because this script makes a call to chefsolo which | ||
| 165 | references files from /opt/depoychef base directory. | ||
| 166 | |||
| 167 | Wait for the script to finish executing and you are shown the prompt. | ||
| 168 | |||
| 169 | In a similar vein, repeat the above process on the COMPUTE node, but this | ||
| 170 | time, it's the CONTROLLER's IP address you will be changing. Leave the COMPUTE's | ||
| 171 | IP address as is. | ||
| 172 | Assuming CONTROLLER's IP address was set to "192.168.7.2" at build-time and the | ||
| 173 | current IP address of the machine on which you have CONTROLLER deployed is | ||
| 174 | "128.224.149.162". Then the line | ||
| 175 | |||
| 176 | default["CONTROLLER_IP"] = "192.168.7.2" | ||
| 177 | |||
| 178 | should be changed to | ||
| 179 | |||
| 180 | default["CONTROLLER_IP"] = "128.224.149.162" | ||
| 181 | |||
| 182 | |||
| 183 | Again 'cd' into the base directory of deploychef and execut the script | ||
| 184 | 'run-deploychef'. | ||
| 185 | |||
| 186 | cd /opt/deploychef | ||
| 187 | ./run-deploychef | ||
| 188 | |||
| 189 | |||
| 190 | At this point, both COMPUTE and CONTROLLER have been configured and should be | ||
| 191 | communicating with one another. | ||
| 192 | |||
| 193 | Maintenance | ||
| 194 | ----------- | ||
| 195 | This class is maintained by Wind River Systems, Inc. | ||
| 196 | Contact <support@windriver.com> or your support representative for more | ||
| 197 | information on submitting changes. | ||
| 198 | |||
| 199 | |||
| 200 | Building with openstack.bbclass | ||
| 201 | ------------------------- | ||
| 202 | This class should be inherited by recipe/class files of openstack services in order | ||
| 203 | for the functionality described above to work. | ||
| 204 | If any component of openstack is left out, that component will | ||
| 205 | not work correctly when the stack is reconfigured at run-time, and as a result, | ||
| 206 | the openstack deployment will not work. | ||
| 207 | |||
| 208 | |||
| 209 | License | ||
| 210 | ------- | ||
| 211 | Copyright (C) 2014 Wind River Systems, Inc. | ||
| 212 | |||
| 213 | The right to copy, distribute or otherwise make use of this software may | ||
| 214 | be licensed only pursuant to the terms of an applicable Wind River license | ||
| 215 | agreement. No license to Wind River intellectual properly rights is granted | ||
| 216 | herein. All rights not licensed by Wind River are reserved by Wind River. | ||
| 217 | |||
| 218 | Source code included in tree is under the LICENSE | ||
| 219 | stated in class file (.bbclass file) unless other stated. | ||
diff --git a/meta-openstack/classes/openstack-base.bbclass b/meta-openstack/classes/openstack-base.bbclass index 718aa1c..05dfdf1 100644 --- a/meta-openstack/classes/openstack-base.bbclass +++ b/meta-openstack/classes/openstack-base.bbclass | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | inherit hosts openstackchef | 1 | inherit hosts |
| 2 | 2 | ||
| 3 | ROOTFS_POSTPROCESS_COMMAND += "openstack_configure_hosts ; " | 3 | ROOTFS_POSTPROCESS_COMMAND += "openstack_configure_hosts ; " |
| 4 | 4 | ||
diff --git a/meta-openstack/classes/openstackchef.bbclass b/meta-openstack/classes/openstackchef.bbclass deleted file mode 100644 index c2e4a40..0000000 --- a/meta-openstack/classes/openstackchef.bbclass +++ /dev/null | |||
| @@ -1,115 +0,0 @@ | |||
| 1 | # openstackchef.bbclass | ||
| 2 | # Copyright (c) 2014 Wind River Systems, Inc. | ||
| 3 | # | ||
| 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 5 | # of this software and associated documentation files (the "Software"), to | ||
| 6 | # deal | ||
| 7 | # in the Software without restriction, including without limitation the rights | ||
| 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 9 | # copies of the Software, and to permit persons to whom the Software is | ||
| 10 | # furnished to do so, subject to the following conditions: | ||
| 11 | # | ||
| 12 | # The above copyright notice and this permission notice shall be included in | ||
| 13 | # all copies or substantial portions of the Software. | ||
| 14 | # | ||
| 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 20 | # FROM, | ||
| 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 22 | # THE SOFTWARE. | ||
| 23 | # | ||
| 24 | # | ||
| 25 | # This class provides a framework for openstack services like python-neutron | ||
| 26 | # or python-nova to register their configuration files so that they can be | ||
| 27 | # recreated at run-time by chef-solo. Inheriting | ||
| 28 | # this class involves exposing configuration files from which this class | ||
| 29 | # creates chef-solo templates. These template files are later used by chef-solo | ||
| 30 | # to recreate the configuration files. | ||
| 31 | # | ||
| 32 | # For the templates files to be created, the recipes are expected | ||
| 33 | # to define the following variables variables: | ||
| 34 | # | ||
| 35 | # SRCNAME: | ||
| 36 | # This is the name of the package, neutron for example for the package | ||
| 37 | # python-neutron. It's appended to the names of template files and also | ||
| 38 | # used in the creation of package based temporary files. A default value | ||
| 39 | # of ${BPN} is assigned to this variable when it's not defined by recipes | ||
| 40 | # inheriting class. | ||
| 41 | # | ||
| 42 | # CHEF_SERVICES_CONF_FILES | ||
| 43 | # | ||
| 44 | # This variable provides the list of configuration files | ||
| 45 | # exposed to this class by the recipes inheriting the class. | ||
| 46 | # These files are expected to be in the image( ${D}) directory, though ${D} | ||
| 47 | # directory is excluded from the file name. Definition of this variable | ||
| 48 | # by recipe files is optional. | ||
| 49 | # eg. | ||
| 50 | # CHEF_SERVICES_CONF_FILES="\ | ||
| 51 | # ${sysconfdir}/chef/neutron/plugins/linuxbridge/linuxbridge_conf.ini.rb \ | ||
| 52 | # ${sysconfdir}/chef/neutron/neutron.conf | ||
| 53 | # " | ||
| 54 | # | ||
| 55 | #INITSCRIPT_PACKAGES | ||
| 56 | #This variable provides a mechanism for recipes inheriting this class | ||
| 57 | #to provide a list of services to start/stop when their configuration files | ||
| 58 | #are recreated on disk. | ||
| 59 | #This variable is assumed to be provided by all recipes that register a set | ||
| 60 | #of configuration files with this class. Failing to do so will lead to | ||
| 61 | #service not reloading the newly created configuration file(s) at run-time. | ||
| 62 | # | ||
| 63 | # | ||
| 64 | #INITSCRIPT_NAME_x or INITSCRIPT_NAME | ||
| 65 | #This variable is also assumed to be set by recipes inheriting this class. | ||
| 66 | #It specifies the names of the services to start/stop as specified above. | ||
| 67 | #Like the variable immediately above, failure to provide this variable will | ||
| 68 | #lead to mis-configuration of the service at run-time. | ||
| 69 | # | ||
| 70 | # | ||
| 71 | #INITSCRIPT_PARAMS_x or INITSCRIPT_PARAMS | ||
| 72 | #Like the last two variable above, this variable is also assumed to be set | ||
| 73 | #by recipes inheriting this class. It is used to extract the run-level | ||
| 74 | #priority of the INITSCRIPT_NAME variable(s). Unlike, the previous two | ||
| 75 | #variables, a default run-level is assigned to the script when this variable | ||
| 76 | #defaults to the string 'default' | ||
| 77 | # | ||
| 78 | # | ||
| 79 | # CHEF_SERVICES_SPECIAL_FUNC | ||
| 80 | # This variable is optional, and is the name of a shell callback function. | ||
| 81 | # Unlike the placeholder/value substitution which this class does, | ||
| 82 | # there are times when recipes need to do more than a simple placeholder/ | ||
| 83 | # value substitution. This is made possible with the use of the callback | ||
| 84 | # function. | ||
| 85 | # The callback function should be defined by the recipe(s) inheriting | ||
| 86 | # this class. When this variable is defined, this class will call the | ||
| 87 | # callback function and pass it the name of the file to manipulate | ||
| 88 | # in the form of the variable CHEF_SERVICES_FILE_NAME. This variable | ||
| 89 | # is then accessed in the callback function in the recipe file as | ||
| 90 | # ${CHEF_SERVICES_FILE_NAME} | ||
| 91 | # | ||
| 92 | inherit hosts openstackchef_inc | ||
| 93 | |||
| 94 | #Call this function after the do_install function have executed in | ||
| 95 | #recipes inheriting this class, this ensures that we get configuration | ||
| 96 | #files that have been moved to the images directory | ||
| 97 | addtask deploychef_install before do_package after do_install | ||
| 98 | python do_deploychef_install() { | ||
| 99 | if deploychef_not_rootfs_class(d) and \ | ||
| 100 | deploychef_openstackchef_enabled(d): | ||
| 101 | #copy configuration files from packages inheriting class | ||
| 102 | template_files_tuple = deploychef_copy_conf_files(d) | ||
| 103 | #convert configuration files into templates for chefsolo | ||
| 104 | deploychef_make_templates( d, template_files_tuple) | ||
| 105 | #Generate a list of startup/shutdown services | ||
| 106 | deploychef_make_startup_shutdown_list(d) | ||
| 107 | } | ||
| 108 | |||
| 109 | #Use of ROOTFS_POSTPROCESS_COMMAND enables us to hook into the post | ||
| 110 | #rootfs creation process and influence the work of openstack_configure_hosts. | ||
| 111 | #However, to ensure that our function deploychef_rootfs_postprocess_commands | ||
| 112 | #is called after openstack_configure_hosts and not before it, | ||
| 113 | #we add it in front of our callback function here. | ||
| 114 | ROOTFS_POSTPROCESS_COMMAND += "openstack_configure_hosts ; deploychef_rootfs_postprocess_commands ; " | ||
| 115 | |||
diff --git a/meta-openstack/classes/openstackchef_inc.bbclass b/meta-openstack/classes/openstackchef_inc.bbclass deleted file mode 100644 index 91adb41..0000000 --- a/meta-openstack/classes/openstackchef_inc.bbclass +++ /dev/null | |||
| @@ -1,831 +0,0 @@ | |||
| 1 | # openstackchef_inc.bbclass | ||
| 2 | # Copyright (c) 2014 Wind River Systems, Inc. | ||
| 3 | # | ||
| 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 5 | # of this software and associated documentation files (the "Software"), to | ||
| 6 | # deal | ||
| 7 | # in the Software without restriction, including without limitation the rights | ||
| 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 9 | # copies of the Software, and to permit persons to whom the Software is | ||
| 10 | # furnished to do so, subject to the following conditions: | ||
| 11 | # | ||
| 12 | # The above copyright notice and this permission notice shall be included in | ||
| 13 | # all copies or substantial portions of the Software. | ||
| 14 | # | ||
| 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONE INFRINGEMENT. IN NO EVENT SHALL THE | ||
| 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 20 | # FROM, | ||
| 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 22 | # THE SOFTWARE. | ||
| 23 | # | ||
| 24 | # | ||
| 25 | #This class is a helper class for openstackchef.bbclass and should not be be | ||
| 26 | #inherited on it's own. It implements the functionalities used in | ||
| 27 | #openstackchef.bbclass | ||
| 28 | CHEFPN = "openstackchef" | ||
| 29 | #This variable is here to support legacy use of recipes that inherit this | ||
| 30 | #class. By default these recipes will be built without openstackchef support. | ||
| 31 | #Set this variable to 'yes' in your local.conf or similar to enable | ||
| 32 | #support for OPENSTACKCHEF. | ||
| 33 | OPENSTACKCHEF_ENABLED ?='' | ||
| 34 | #This variable is defined in most of the openstack services, however, | ||
| 35 | #it defaults to bare package name for packages that do not define it. | ||
| 36 | SRCNAME ?= "${BPN}" | ||
| 37 | #This is the base directory of where deploychef's templates files | ||
| 38 | #reside in the classes that inherit it. | ||
| 39 | CHEF_TEMPLATE_BASE="${D}${sysconfdir}/${CHEFPN}" | ||
| 40 | CHEF_PACKAGE_BASE="${WORKDIR}/package${sysconfdir}/${CHEFPN}" | ||
| 41 | CHEF_IMAGE_BASE="${D}${sysconfdir}" | ||
| 42 | CHEF_ROOTFS_BASE="${sysconfdir}/${CHEFPN}" | ||
| 43 | #These are the prefixs and suffixs to create chefsolo-like placeholders | ||
| 44 | ERB_PREFIX = "<%=node[:" | ||
| 45 | ERB_SUFFIX = "]%>" | ||
| 46 | #These prefix and suffix are used to create our default values | ||
| 47 | ERB_DEFAULT_PREFIX="default[" | ||
| 48 | ERB_DEFAULT_SUFFIX="]" | ||
| 49 | #Chefsolo template file extension | ||
| 50 | TEMPLATE_EXTENSION='.erb' | ||
| 51 | #Build deploychef package since this class has run-time and buil-time dependency | ||
| 52 | #on it | ||
| 53 | DEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'chef', 'deploychef', '', d)}" | ||
| 54 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'chef', 'deploychef', '', d)}" | ||
| 55 | CHEF_VERSION = '1' | ||
| 56 | #For classes that define a special substitution function, this variable is | ||
| 57 | #set by this class and specifies the file named passed back to these function | ||
| 58 | #for any special substitution. | ||
| 59 | CHEF_SERVICES_FILE_NAME ?='' | ||
| 60 | |||
| 61 | #These are hard coded in the recipes files where they are used. | ||
| 62 | ADMIN_TENANT_NAME ?= 'admin' | ||
| 63 | DEMO_USER ?= 'demo' | ||
| 64 | #This is dafault value used by update-rc.d script at runtime when | ||
| 65 | #build-time update-rd.d class specifies INITSCRIPT_PARAMS as 'defaults' | ||
| 66 | CHEF_INITSCRIPT_PARAMS='defaults 20 10' | ||
| 67 | |||
| 68 | def deploychef_services_default_sub_dict(d): | ||
| 69 | """Provides our placeholder/value substitution dictionary for global use | ||
| 70 | |||
| 71 | This function returns as dictionary containing the default substitution pattern | ||
| 72 | as follows: | ||
| 73 | :<key>: Name of placeholder variable | ||
| 74 | :<value>: A tuple consisting of the place holder variable followed | ||
| 75 | by its default value | ||
| 76 | """ | ||
| 77 | sub_dict={} | ||
| 78 | #neutron | ||
| 79 | sub_dict['SERVICE_TENANT_NAME'] = ('%SERVICE_TENANT_NAME%' , | ||
| 80 | '${SERVICE_TENANT_NAME}') | ||
| 81 | sub_dict['SERVICE_PASSWORD'] = ('%SERVICE_PASSWORD%' , '${SERVICE_PASSWORD}') | ||
| 82 | |||
| 83 | sub_dict['DB_USER'] = ('%DB_USER%', '${DB_USER}') | ||
| 84 | sub_dict['DB_PASSWORD'] = ('%DB_PASSWORD%' , '${DB_PASSWORD}') | ||
| 85 | sub_dict['CONTROLLER_IP'] = ('%CONTROLLER_IP%', '${CONTROLLER_IP}') | ||
| 86 | sub_dict['CONTROLLER_HOST'] = ('%CONTROLLER_HOST%', '${CONTROLLER_HOST}') | ||
| 87 | #nova | ||
| 88 | sub_dict['COMPUTE_IP'] = ('%COMPUTE_IP%', '${COMPUTE_IP}') | ||
| 89 | sub_dict['COMPUTE_HOST'] = ('%COMPUTE_HOST%', '${COMPUTE_HOST}') | ||
| 90 | sub_dict['LIBVIRT_IMAGES_TYPE'] = ('%LIBVIRT_IMAGES_TYPE%' , '${LIBVIRT_IMAGES_TYPE}') | ||
| 91 | sub_dict['OS_PASSWORD'] = ('%OS_PASSWORD%' , '${ADMIN_PASSWORD}') | ||
| 92 | sub_dict['SERVICE_TOKEN'] = ('%SERVICE_TOKEN%' , '${SERVICE_TOKEN}') | ||
| 93 | #swfit | ||
| 94 | sub_dict['ADMIN_TENANT_NAME'] = ('%ADMIN_TENANT_NAME%' , '${ADMIN_TENANT_NAME}') | ||
| 95 | sub_dict['ADMIN_USER'] = ('%ADMIN_USER%' , '${ADMIN_TENANT_NAME}') | ||
| 96 | sub_dict['ADMIN_PASSWORD'] = ('%ADMIN_PASSWORD%' , '${ADMIN_PASSWORD}') | ||
| 97 | sub_dict['DEMO_USER'] = ('%DEMO_USER%' , '${DEMO_USER}') | ||
| 98 | sub_dict['DEMO_PASSWORD'] = ('%DEMO_PASSWORD%' , '${ADMIN_PASSWORD}') | ||
| 99 | #ceilometer | ||
| 100 | sub_dict['CEILOMETER_SECRET'] = ('%CEILOMETER_SECRET%' , '${CEILOMETER_SECRET}') | ||
| 101 | |||
| 102 | #keystone | ||
| 103 | sub_dict['TOKEN_FORMAT'] = ('%TOKEN_FORMAT%' , '${TOKEN_FORMAT}') | ||
| 104 | sub_dict['METADATA_SHARED_SECRET'] = ('%METADATA_SHARED_SECRET%' , '${METADATA_SHARED_SECRET}') | ||
| 105 | #cinder | ||
| 106 | sub_dict['CINDER_BACKUP_BACKEND_DRIVER'] = ('%CINDER_BACKUP_BACKEND_DRIVER%' , '${CINDER_BACKUP_BACKEND_DRIVER}') | ||
| 107 | #cloud-init | ||
| 108 | sub_dict['MANAGE_HOSTS'] = ('%MANAGE_HOSTS%' , '${MANAGE_HOSTS}') | ||
| 109 | sub_dict['HOSTNAME'] = ('%HOSTNAME%' , '${MY_HOST}') | ||
| 110 | #postgresql | ||
| 111 | sub_dict['DB_DATADIR'] = ('%DB_DATADIR%' , '${DB_DATADIR}') | ||
| 112 | #glance | ||
| 113 | sub_dict['GLANCE_DEFAULT_STORE'] = ('%GLANCE_DEFAULT_STORE%' , '${GLANCE_DEFAULT_STORE}') | ||
| 114 | |||
| 115 | #barbican | ||
| 116 | sub_dict['BARBICAN_MAX_PACKET_SIZE'] = ('%BARBICAN_MAX_PACKET_SIZE%' , '${BARBICAN_MAX_PACKET_SIZE}') | ||
| 117 | #ceph | ||
| 118 | sub_dict['PUBLIC_IP'] = ('%PUBLIC_IP%' , '${CONTROLLER_IP}') | ||
| 119 | sub_dict['PRIVATE_IP'] = ('%PRIVATE_IP%' , '${MY_IP}') | ||
| 120 | sub_dict['PUBLIC_DOMAIN'] = ('%PUBLIC_DOMAIN%' , '${PUBLIC_DOMAIN}') | ||
| 121 | sub_dict['HOST_NAME'] = ('%HOST_NAME%' , '${MY_HOST}') | ||
| 122 | sub_dict['CEPH_BACKING_FILE_SIZE'] = ('%CEPH_BACKING_FILE_SIZE%' , '${CEPH_BACKING_FILE_SIZE}') | ||
| 123 | |||
| 124 | #Most of the services have SERVICE_USER define but the values are different | ||
| 125 | service_user = d.getVar('SRCNAME', True) | ||
| 126 | if service_user: | ||
| 127 | service_user = service_user.upper() + '_SERVICE_USER' | ||
| 128 | sub_dict[service_user] = ('%SERVICE_USER%' , '${SRCNAME}') | ||
| 129 | return sub_dict | ||
| 130 | |||
| 131 | #This variable is the default sets of substitutions common to most of the | ||
| 132 | #services in an openstack installation. It means this package is not completely | ||
| 133 | #agnostic but at the same time it gives us the added advantage of not repeating | ||
| 134 | #ourselves in the recipe/class files that inherits this class. | ||
| 135 | CHEF_SERVICES_DEFAULT_CONF_SUBS := "${@deploychef_services_default_sub_dict(d)}" | ||
| 136 | |||
| 137 | |||
| 138 | def deploychef_not_rootfs_class(d): | ||
| 139 | """Filter out rootfs related classes | ||
| 140 | |||
| 141 | This function is used to help us selectively executes the creation of template | ||
| 142 | files and daemon start/stop list. It allows us to executes certain functions | ||
| 143 | when the recipe inheriting this class is related to rootfs creation. | ||
| 144 | """ | ||
| 145 | pkg = d.getVar('PN', True) or d.getVar('BPN', True) | ||
| 146 | #Skip test if recipe/class calling this class is related to rootfs image | ||
| 147 | #creation. | ||
| 148 | if 'image-' in pkg: | ||
| 149 | return False | ||
| 150 | else: | ||
| 151 | return True | ||
| 152 | |||
| 153 | def deploychef_openstackchef_enabled(d): | ||
| 154 | """Find out if openstackchef class usage is enabled | ||
| 155 | |||
| 156 | The variable OPENSTACKCHEF_ENABLED is use to support legacy functionality | ||
| 157 | by recipes inheriting this class. Assinging it an empty string disables | ||
| 158 | the functionality of this class for that recipe file. | ||
| 159 | This function helps us detect when this variable is set to an empty string. | ||
| 160 | """ | ||
| 161 | chef = d.getVar('OPENSTACKCHEF_ENABLED', True) | ||
| 162 | #Skip test if recipe/class calling this class is related to rootfs image | ||
| 163 | #creation. | ||
| 164 | if chef != '' : | ||
| 165 | return True | ||
| 166 | else: | ||
| 167 | return False | ||
| 168 | |||
| 169 | def deploychef_make_startup_shutdown_list(d): | ||
| 170 | """Create list of services to start/stop and save them to file | ||
| 171 | |||
| 172 | This function uses the update-rc.d environment variables defined | ||
| 173 | in the recipes/classes inheriting this class to create the | ||
| 174 | startup and shutdown services list as defined in the file. | ||
| 175 | This is important because, when we are replacing the configuration | ||
| 176 | files for the services, the services needs to be shutdown and | ||
| 177 | restarted after their configuration files are edited. | ||
| 178 | Therefore, the following variables must be defined by classes inheriting | ||
| 179 | this class. | ||
| 180 | |||
| 181 | INITSCRIPT_PACKAGES: A list of init scripts | ||
| 182 | INITSCRIPT_PARAMS_x: The default start/stop priority for the above scripts | ||
| 183 | """ | ||
| 184 | |||
| 185 | import os | ||
| 186 | if d.getVar('INITSCRIPT_PACKAGES') or d.getVar('INITSCRIPT_NAME'): | ||
| 187 | #script_list = d.getVar('INITSCRIPT_PACKAGES', 1) | ||
| 188 | script_list = d.getVar('INITSCRIPT_PACKAGES', True) or \ | ||
| 189 | d.getVar('INITSCRIPT_NAME', True) #Some package do not define INITSCRIPT_PACKAGES | ||
| 190 | msg="list of start/stop services: %s" % str(script_list) | ||
| 191 | bb.debug(2, msg) | ||
| 192 | base_dir = d.getVar('CHEF_TEMPLATE_BASE', 1 ) | ||
| 193 | if not os.path.exists(base_dir): | ||
| 194 | os.mkdir(base_dir) | ||
| 195 | startup_file = os.path.join(base_dir, d.getVar('SRCNAME', True) +'-startup-list') | ||
| 196 | shutdown_file = os.path.join(base_dir, d.getVar('SRCNAME', True) +'-shutdown-list') | ||
| 197 | msg ="Startup and shutdown files %s %s saved to %s" % \ | ||
| 198 | ( startup_file, shutdown_file, base_dir) | ||
| 199 | bb.note(msg) | ||
| 200 | try: | ||
| 201 | hStartup = open(startup_file, 'w') | ||
| 202 | hShutdown = open(shutdown_file, 'w') | ||
| 203 | for script_name in script_list.split(): | ||
| 204 | #Retrieve the default params for update-rc.d for this script | ||
| 205 | #INITSCRIPT_PARAMS_nova-api="defaults 30 10" | ||
| 206 | init_script_name ="INITSCRIPT_NAME_%s" % script_name | ||
| 207 | init_script_name = d.getVar(init_script_name, True) or \ | ||
| 208 | d.getVar('INITSCRIPT_NAME', True) | ||
| 209 | |||
| 210 | script_params ="INITSCRIPT_PARAMS_%s" % script_name | ||
| 211 | script_params = d.getVar(script_params, True) or \ | ||
| 212 | d.getVar('INITSCRIPT_PARAMS', True) | ||
| 213 | #If only defaults is provided as parameter, then use our default priority | ||
| 214 | if not script_params or len(script_params.split()) < 3: | ||
| 215 | script_params = d.getVar('CHEF_INITSCRIPT_PARAMS', True) | ||
| 216 | if init_script_name: | ||
| 217 | #eg. start 20 5 3 2 . stop 80 0 1 6 . | ||
| 218 | startup_priority = shutdown_priority = '' | ||
| 219 | if script_params.find('stop') > 0: | ||
| 220 | start, stop = script_params.split('stop') | ||
| 221 | start = start.split() | ||
| 222 | stop = stop.split() | ||
| 223 | startup_priority = start[1] | ||
| 224 | shutdown_priority = stop[0] | ||
| 225 | elif script_params.find('stop') == 0: | ||
| 226 | start, stop = script_params.split('start') | ||
| 227 | start = start.split() | ||
| 228 | stop = stop.split() | ||
| 229 | startup_priority = start[0] | ||
| 230 | shutdown_priority = stop[1] | ||
| 231 | else: | ||
| 232 | #"defaults 20 10" | ||
| 233 | defaults = script_params.split() | ||
| 234 | startup_priority = defaults[1] | ||
| 235 | shutdown_priority = defaults[2] | ||
| 236 | #Arrange the script's startup/shutdown format as in rc.x | ||
| 237 | startup_string = "%s%s%s%s" % ('S', startup_priority, init_script_name, os.linesep) | ||
| 238 | shutdown_string = "%s%s%s%s" % ('K', shutdown_priority, init_script_name, os.linesep) | ||
| 239 | hStartup.write(startup_string) | ||
| 240 | hShutdown.write(shutdown_string) | ||
| 241 | msg = "%s %s registered for startup and shutdown in" % \ | ||
| 242 | (startup_string, shutdown_string) | ||
| 243 | bb.debug(2 , msg) | ||
| 244 | else: | ||
| 245 | msg = "The variables INITSCRIPT_PARAMS_%s or INITSCRIPT_PARAMS \ | ||
| 246 | are not set in %s, startup/shutdown list not created for %s: %s" \ | ||
| 247 | % (script_name, d.getVar('FILE', True), d.getVar('SRCNAME', True), script_params) | ||
| 248 | raise bb.build.FuncFailed(msg) | ||
| 249 | hStartup.close() | ||
| 250 | hShutdown.close() | ||
| 251 | except IOError as e: | ||
| 252 | bb.error("Error opening startup/shutdown files %s %s, %s %s" % \ | ||
| 253 | (startup_file, shutdown_file, d.getVar('FILE'), e)) | ||
| 254 | else: | ||
| 255 | msg = "The variable INITSCRIPT_PACKAGES is not set in %s, \ | ||
| 256 | startup/shutdown script will not be made for %s package" % \ | ||
| 257 | (d.getVar('FILE', True), d.getVar('SRCNAME', True)) | ||
| 258 | bb.build.FuncFailed(msg) | ||
| 259 | |||
| 260 | def deploychef_make_substitutions(d, sub_dict, attr_filename, sed_filename): | ||
| 261 | """Make placeholder/value substitution in a file | ||
| 262 | |||
| 263 | This function makes placeholder substitution into the file named | ||
| 264 | sed_filename and appends the default value for those substitution into | ||
| 265 | the file named attr_filename. | ||
| 266 | The substitution is based on sets of placeholder/value pair in the | ||
| 267 | dictionary called sub_dict. | ||
| 268 | :sub_dict: name, placeholder and value dictionary | ||
| 269 | :attr_filename: chef-solo attributes file name | ||
| 270 | :sed_filename: configuration or template file | ||
| 271 | """ | ||
| 272 | if attr_filename and sed_filename: | ||
| 273 | if type(sub_dict) is dict: | ||
| 274 | import os | ||
| 275 | import re | ||
| 276 | sHandle = open(sed_filename, 'r+') | ||
| 277 | lines_in_conf_file = sHandle.read() | ||
| 278 | #We only want to append to the list of defines needed by this class | ||
| 279 | hFile= open(attr_filename,'a+') | ||
| 280 | lines_in_file= hFile.read() | ||
| 281 | for key in sub_dict.keys(): | ||
| 282 | placeholder , replacement = sub_dict[key] | ||
| 283 | #Filter by placeholder so that our attribute file only include | ||
| 284 | #defines for class being built | ||
| 285 | if re.search(placeholder,lines_in_conf_file): | ||
| 286 | #Make the substitution to create a template file out of | ||
| 287 | #the configuration file or just replace placeholder in | ||
| 288 | #configuration file | ||
| 289 | if d.getVar('TEMPLATE_EXTENSION', True) in sed_filename: | ||
| 290 | #Format the default attributes as expected by chefsolo | ||
| 291 | #for template file. | ||
| 292 | attr_string = d.getVar('ERB_DEFAULT_PREFIX', True) | ||
| 293 | attr_string += r'"' + key | ||
| 294 | attr_string += r'"' + d.getVar('ERB_DEFAULT_SUFFIX', True) | ||
| 295 | attr_string +=' = ' + r'"' + replacement + r'"' | ||
| 296 | #Only write default values that do not yet exist in file | ||
| 297 | #if key not in lines_in_file: | ||
| 298 | if not re.search(key,lines_in_file): | ||
| 299 | hFile.write("%s%s" % (attr_string, os.linesep)) | ||
| 300 | #Replace the placeholders in the current file, with | ||
| 301 | #new_replacement | ||
| 302 | new_replacement = d.getVar('ERB_PREFIX') + key | ||
| 303 | new_replacement += d.getVar('ERB_SUFFIX') | ||
| 304 | lines_in_conf_file = re.sub(placeholder, new_replacement, lines_in_conf_file) | ||
| 305 | #Write template file to disk | ||
| 306 | sHandle.seek(0) | ||
| 307 | sHandle.truncate() | ||
| 308 | sHandle.write(lines_in_conf_file) | ||
| 309 | sHandle.close() | ||
| 310 | |||
| 311 | hFile.close() | ||
| 312 | if False: | ||
| 313 | msg = "Cannot read/write to attributes file %s as expected:%s"\ | ||
| 314 | % (attr_filename, d.getVar('FILE')) | ||
| 315 | bb.build.FuncFailed(msg) | ||
| 316 | else: | ||
| 317 | msg = "The substitution dictionary variable sub_dict is not set %s as expected "\ | ||
| 318 | % d.getVar('FILE') | ||
| 319 | bb.error(msg) | ||
| 320 | else: | ||
| 321 | msg = "Null file names passsed to function %s %s "\ | ||
| 322 | % (d.getVar('FUNC'), d.getVar('FILE')) | ||
| 323 | bb.error(msg) | ||
| 324 | |||
| 325 | |||
| 326 | |||
| 327 | def deploychef_make_templates( d, conf_tuple=tuple()): | ||
| 328 | """Create a template file out of a configuration file | ||
| 329 | |||
| 330 | Using substitution placeholders and values in the substitution | ||
| 331 | dictionary declared as CHEF_SERVICES_DEFAULT_CONF_SUBS, this function | ||
| 332 | makes the substitution for all placeholders. If the file is a ruby template file, | ||
| 333 | it replaces the placeholders with a chefsolo expression; | ||
| 334 | thereby creating a chefsolo template file. | ||
| 335 | |||
| 336 | :conf_tuple: List of configuration files | ||
| 337 | """ | ||
| 338 | |||
| 339 | if len(conf_tuple): | ||
| 340 | import os, ast | ||
| 341 | base_dir = d.getVar('CHEF_TEMPLATE_BASE', 1 ) | ||
| 342 | attr_file = os.path.join(base_dir, d.getVar('SRCNAME', True) + '-attributes.rb') | ||
| 343 | msg ="Default attributes saved to %s" % attr_file | ||
| 344 | if os.path.exists(attr_file): | ||
| 345 | os.remove(attr_file) | ||
| 346 | bb.note(msg) | ||
| 347 | try: | ||
| 348 | for file_name in conf_tuple: | ||
| 349 | #If a special substitution function is defined for class | ||
| 350 | #inheriting this class, set the file name expected by special | ||
| 351 | #function before calling the function | ||
| 352 | special_func_name = d.getVar('CHEF_SERVICES_SPECIAL_FUNC') | ||
| 353 | if special_func_name: | ||
| 354 | bb.data.setVar('CHEF_SERVICES_FILE_NAME', file_name,\ | ||
| 355 | d) | ||
| 356 | bb.build.exec_func(special_func_name, d) | ||
| 357 | |||
| 358 | #Make the necessary susbstitutions using the default | ||
| 359 | #substitutiin dictionary | ||
| 360 | sub_dict = d.getVar('CHEF_SERVICES_DEFAULT_CONF_SUBS', 1) | ||
| 361 | msg = "The variable %s is not set in %s as a dictionary as expected "\ | ||
| 362 | % ('CHEF_SERVICES_DEFAULT_CONF_SUBS', d.getVar('FILE')) | ||
| 363 | if sub_dict: | ||
| 364 | #Safely retrieve our python data structure | ||
| 365 | sub_dict = ast.literal_eval(sub_dict) | ||
| 366 | if type(sub_dict) is dict: | ||
| 367 | deploychef_make_substitutions(d, sub_dict, attr_file, file_name) | ||
| 368 | else: | ||
| 369 | raise bb.build.FuncFailed(msg) | ||
| 370 | else: | ||
| 371 | raise bb.build.FuncFailed(msg) | ||
| 372 | #Make the necessary susbstitutions using auxilliary dictionary | ||
| 373 | #if provided by inheriting class | ||
| 374 | sub_dict = d.getVar('CHEF_SERVICES_CONF_SUBS', 1) | ||
| 375 | if sub_dict: | ||
| 376 | sub_dict = ast.literal_eval(sub_dict) | ||
| 377 | msg = "The variable %s is not set in %s as a dictionary as expected "\ | ||
| 378 | % ('CHEF_SERVICES_CONF_SUB', d.getVar('FILE')) | ||
| 379 | if type(sub_dict) is dict: | ||
| 380 | pass | ||
| 381 | deploychef_make_substitutions(d, sub_dict, attr_file, file_name) | ||
| 382 | else: | ||
| 383 | bb.build.FuncFailed(msg) | ||
| 384 | except IOError as e: | ||
| 385 | bb.error("Could not write to attribute file %s: in %s, %s" % \ | ||
| 386 | (attr_file, d.getVar('FILE'), e)) | ||
| 387 | |||
| 388 | def deploychef_copy_single_conf_file(d, dst_base, conf_file): | ||
| 389 | """Create a chef-solo template from an openstack configuration file | ||
| 390 | |||
| 391 | This function copies a single configuration file (conf_file) | ||
| 392 | to destination directory (dst_dir) and return a tuple that contains | ||
| 393 | both the absolute path of the conf_file and the template files it was | ||
| 394 | copied as. | ||
| 395 | """ | ||
| 396 | if conf_file: | ||
| 397 | import shutil | ||
| 398 | import os | ||
| 399 | #Create the absolute path to configuration file since it's with relative | ||
| 400 | #to image directory | ||
| 401 | image_base = d.getVar('D', True) | ||
| 402 | if conf_file.startswith(os.sep): | ||
| 403 | conf_file=conf_file[1:] | ||
| 404 | abs_conf_path = os.path.join(image_base, conf_file) | ||
| 405 | |||
| 406 | if os.path.exists(abs_conf_path): | ||
| 407 | dst_base = os.path.join(dst_base, os.path.dirname(conf_file)) | ||
| 408 | #make room for the template file about to be created | ||
| 409 | if not os.path.exists(dst_base): | ||
| 410 | os.makedirs(dst_base) | ||
| 411 | |||
| 412 | abs_template_file = os.path.basename(conf_file) + \ | ||
| 413 | d.getVar('TEMPLATE_EXTENSION', True) + '.' + d.getVar('SRCNAME', True) | ||
| 414 | abs_template_file = os.path.join(dst_base, abs_template_file) | ||
| 415 | #Copy conf file as template file | ||
| 416 | shutil.copy(abs_conf_path, abs_template_file) | ||
| 417 | msg = "\nConf file: %s\n Copied to: %s \n"\ | ||
| 418 | % (abs_conf_path, abs_template_file) | ||
| 419 | bb.debug(2, msg) | ||
| 420 | return (abs_conf_path, abs_template_file) | ||
| 421 | else: | ||
| 422 | msg = "Configuration file: %s in %s does not \ | ||
| 423 | exist" % (abs_conf_path, d.getVar('FILE')) | ||
| 424 | raise bb.build.FuncFailed(msg) | ||
| 425 | else: | ||
| 426 | msg = "The specified configuration file destined for %s in %s is an empty string\n" \ | ||
| 427 | % (dst_base, d.getVar('FILE')) | ||
| 428 | raise bb.build.FuncFailed(msg) | ||
| 429 | |||
| 430 | |||
| 431 | |||
| 432 | def deploychef_copy_conf_files(d): | ||
| 433 | """Copy openstack services' configuration files to be used as chef-solo templates | ||
| 434 | |||
| 435 | Copy the configuration file(s) for the services under | ||
| 436 | ${D}${sysconfdir}/${CHEFPN}/<conf_file>. | ||
| 437 | The file(s) is/are assumed to be located in the images directory; ${D}<conf_file> | ||
| 438 | And evaluate all necessary substitution in the configuration file. | ||
| 439 | """ | ||
| 440 | abs_template_list = list() | ||
| 441 | abs_conf_list = list() | ||
| 442 | |||
| 443 | #Retrieve our string of configuration files | ||
| 444 | conf_files = d.getVar('CHEF_SERVICES_CONF_FILES', True ) | ||
| 445 | #The template files that will be made from the configuration files will be | ||
| 446 | #copied with reference to this base directory. | ||
| 447 | dst_base = d.getVar('CHEF_TEMPLATE_BASE', True ) | ||
| 448 | if conf_files and len(conf_files.strip()): | ||
| 449 | conf_files = conf_files.split() | ||
| 450 | if len(conf_files) != 1: | ||
| 451 | for conf_file in conf_files: | ||
| 452 | abs_conf_path, abs_template_path = deploychef_copy_single_conf_file(d, \ | ||
| 453 | dst_base, conf_file) | ||
| 454 | if abs_template_path: | ||
| 455 | #Save the absolute path to the template file | ||
| 456 | abs_template_list.append(abs_template_path) | ||
| 457 | if abs_conf_path: | ||
| 458 | #Save the absolute path to the configuration file | ||
| 459 | abs_conf_list.append(abs_conf_path) | ||
| 460 | else: | ||
| 461 | abs_conf_path, abs_template_path = deploychef_copy_single_conf_file(d,\ | ||
| 462 | dst_base, conf_files[0]) | ||
| 463 | if abs_template_path: | ||
| 464 | #Save the absolute path to the template file | ||
| 465 | abs_template_list.append(abs_template_path) | ||
| 466 | if abs_conf_path: | ||
| 467 | #Save the absolute path to the template file | ||
| 468 | abs_conf_list.append(abs_conf_path) | ||
| 469 | #Since the recipes no longer do the substitution in the | ||
| 470 | #configuration files, let us do it for the configuration files | ||
| 471 | deploychef_make_templates(d, tuple(abs_conf_list)) | ||
| 472 | else: | ||
| 473 | msg = "The variable CHEF_SERVICES_CONF_FILES is not set" | ||
| 474 | msg += " in %s as a list of files as expected" % d.getVar('FILE', True) | ||
| 475 | #raise bb.build.FuncFailed(msg) | ||
| 476 | #No longer a requirement that all recipes inheriting this | ||
| 477 | #class must have a set of configuration files. | ||
| 478 | bb.debug(2,msg) | ||
| 479 | return tuple(abs_template_list) | ||
| 480 | |||
| 481 | def deploychef_postinst_substitutions(d, sub_dict, postinst): | ||
| 482 | """Make value substitution in openstack services' postinstall scripts | ||
| 483 | |||
| 484 | This function makes all necessary substitution in the 'setup' related postinsts | ||
| 485 | functions pgk_postinst_${PN}-setup. The substitution is base on entries in a | ||
| 486 | dictionary sub_dict. In addition it also updates the list of defined constansts | ||
| 487 | based on the values specified in dictionary or as specified by the recipe's | ||
| 488 | callback function. | ||
| 489 | |||
| 490 | :sub_dict: name, placeholder and value substitution dictionary | ||
| 491 | :postinst: content of an openstack service's postinstall script | ||
| 492 | |||
| 493 | """ | ||
| 494 | if postinst: | ||
| 495 | if type(sub_dict) is dict: | ||
| 496 | import re | ||
| 497 | base_dir = d.getVar('CHEF_PACKAGE_BASE', True) | ||
| 498 | attr_filename = os.path.join(base_dir, d.getVar('SRCNAME', True) + '-attributes.rb') | ||
| 499 | if os.path.exists(attr_filename): | ||
| 500 | hFile= open(attr_filename,'a+') | ||
| 501 | lines_in_file= hFile.read() | ||
| 502 | for key in sub_dict.keys(): | ||
| 503 | placeholder , replacement = sub_dict[key] | ||
| 504 | if replacement and ( re.search(placeholder, postinst) or \ | ||
| 505 | re.search(replacement, postinst)): | ||
| 506 | #If there is any remaining placeholder in the current string | ||
| 507 | #replace it. | ||
| 508 | new_replacement = d.getVar('ERB_PREFIX') + key | ||
| 509 | new_replacement += d.getVar('ERB_SUFFIX') | ||
| 510 | |||
| 511 | updated_postinst = re.sub(placeholder, new_replacement, postinst) | ||
| 512 | #If the placeholder has been substituted, look for the | ||
| 513 | #substitution and replace it with our template value | ||
| 514 | updated_postinst = re.sub(replacement, new_replacement, updated_postinst) | ||
| 515 | #Update our attributes file with the updated replacement | ||
| 516 | #string | ||
| 517 | attr_string = d.getVar('ERB_DEFAULT_PREFIX', True) | ||
| 518 | attr_string += r'"' + key | ||
| 519 | attr_string += r'"' + d.getVar('ERB_DEFAULT_SUFFIX', True) | ||
| 520 | attr_string +=' = ' + r'"' + replacement + r'"' | ||
| 521 | #Only write default values that do not yet exist in file | ||
| 522 | #if key not in lines_in_file: | ||
| 523 | if not re.search(key,lines_in_file): | ||
| 524 | hFile.write("%s%s" % (attr_string, os.linesep)) | ||
| 525 | |||
| 526 | postinst_msg= "placeholder %s \n replacement %s \n updated_postinst :\n %s \n" % \ | ||
| 527 | (placeholder, replacement, updated_postinst) | ||
| 528 | bb.debug(2, postinst_msg) | ||
| 529 | postinst = updated_postinst | ||
| 530 | hFile.close() | ||
| 531 | else: | ||
| 532 | msg = "The substitution dictionary variable sub_dict is not set %s as expected "\ | ||
| 533 | % d.getVar('FILE') | ||
| 534 | bb.build.FuncFailed(msg) | ||
| 535 | else: | ||
| 536 | msg = "Null string passsed to function %s %s "\ | ||
| 537 | % (d.getVar('FUNC'), d.getVar('FILE')) | ||
| 538 | bb.build.FuncFailed(msg) | ||
| 539 | return postinst | ||
| 540 | |||
| 541 | def deploychef_update_package_postinsts(d): | ||
| 542 | """Make placeholder/value substitution in openstack postinstall scripts | ||
| 543 | |||
| 544 | This function searches all the 'setup' related post-install scripts for | ||
| 545 | references to placeholders of interest; such as %CONTROLLER_IP%. | ||
| 546 | It replaces any such reference when it does find one with a placeholder | ||
| 547 | (<%=node[:CONTROLLER_IP]%>); that essentially converts the post-install | ||
| 548 | script to a chefsolo template. | ||
| 549 | """ | ||
| 550 | def update_postinst_package(pkg): | ||
| 551 | bb.debug(1, 'Updating placeholders in postinst for pkg_postinst_%s scripts' % pkg) | ||
| 552 | |||
| 553 | ldata = bb.data.createCopy(d) | ||
| 554 | overrides = ldata.getVar("OVERRIDES", True) | ||
| 555 | |||
| 556 | msg = "%s The override variable is %s" % (pkg, overrides) | ||
| 557 | bb.note(msg) | ||
| 558 | ldata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides)) | ||
| 559 | |||
| 560 | bb.data.update_data(ldata) | ||
| 561 | postinst = ldata.getVar('pkg_postinst', True) | ||
| 562 | if postinst: | ||
| 563 | #Make the necessary substitutions using the default | ||
| 564 | #substitution dictionary | ||
| 565 | overrides = d.getVar("OVERRIDES", True) | ||
| 566 | msg = "%s The override variable is %s :\n %s " % (pkg, overrides, postinst) | ||
| 567 | bb.note(msg) | ||
| 568 | sub_dict = d.getVar('CHEF_SERVICES_DEFAULT_CONF_SUBS', 1) | ||
| 569 | msg = "The variable %s is not set in %s as a dictionary as expected "\ | ||
| 570 | % ('CHEF_SERVICES_DEFAULT_CONF_SUBS', d.getVar('FILE')) | ||
| 571 | if sub_dict: | ||
| 572 | import ast | ||
| 573 | #Safely retrieve our python data structure | ||
| 574 | sub_dict = ast.literal_eval(sub_dict) | ||
| 575 | if type(sub_dict) is dict: | ||
| 576 | import re | ||
| 577 | updated_postinst = deploychef_postinst_substitutions(d, sub_dict, postinst) | ||
| 578 | #Replace the placeholders in postinst script if any | ||
| 579 | d.setVar('pkg_postinst_%s' % pkg, updated_postinst) | ||
| 580 | else: | ||
| 581 | raise bb.build.FuncFailed(msg) | ||
| 582 | else: | ||
| 583 | raise bb.build.FuncFailed(msg) | ||
| 584 | else: | ||
| 585 | msg= "pkg_postinst_%s does not exist for %s\n" % (pkg, str(ldata)) | ||
| 586 | bb.note(msg) | ||
| 587 | bb.build.FuncFailed(msg) | ||
| 588 | |||
| 589 | packages = (d.getVar('PACKAGES', True) or "").split() | ||
| 590 | if packages != []: | ||
| 591 | for pkg in packages: | ||
| 592 | if pkg.endswith('setup'): | ||
| 593 | update_postinst_package(pkg) | ||
| 594 | |||
| 595 | python populate_packages_append() { | ||
| 596 | |||
| 597 | deploychef_update_package_postinsts(d) | ||
| 598 | } | ||
| 599 | |||
| 600 | def deploychef_add_file_to_FILES_PN(d, conf_file=None): | ||
| 601 | """Add all directories under a file name to FILES_${PN} variable | ||
| 602 | |||
| 603 | This function appends the name of the template file to the FILES_${PN}/${BPN} | ||
| 604 | bitbake variable to avoid QA warning about files built but not | ||
| 605 | added to rootfs. $CHEF_TEMPLATE_BASE/conf_file. Note that conf_file | ||
| 606 | is relative to the root filesystem as in /etc/neutron/neutron.conf | ||
| 607 | The template file will be located in /etc/${CHEFPN}/etc/neutron/neutron.conf.rb | ||
| 608 | Thefore, we need to make sure that all directories above the | ||
| 609 | template file are added to FILES_${PN} variable. | ||
| 610 | |||
| 611 | :conf_file: a chef-solo template file | ||
| 612 | """ | ||
| 613 | import re | ||
| 614 | import os | ||
| 615 | #Perform an override so that we can update FILES_${PN} variables | ||
| 616 | ldata = bb.data.createCopy(d) | ||
| 617 | overrides = ldata.getVar("OVERRIDES", True) | ||
| 618 | pkg = d.getVar('PN', True) or d.getVar('BPN', True) | ||
| 619 | files = d.getVar('FILES_%s' % pkg, True) | ||
| 620 | pkg_files = "FILES_%s" % pkg | ||
| 621 | ldata.setVar("OVERRIDES", "%s:%s" % (pkg_files, overrides)) | ||
| 622 | bb.data.update_data(ldata) | ||
| 623 | |||
| 624 | dest_base = d.getVar('CHEF_TEMPLATE_BASE', True) | ||
| 625 | pkg_imagedir = d.getVar('CHEF_ROOTFS_BASE', True) | ||
| 626 | #Add the packages image base directory if it does not already exist | ||
| 627 | if re.search(pkg_imagedir, files) == None: | ||
| 628 | #All the directory and all files in it | ||
| 629 | files = "%s %s" % ( files, pkg_imagedir) | ||
| 630 | files = "%s %s%s*" % ( files, pkg_imagedir, os.sep ) | ||
| 631 | d.setVar('FILES_%s' % pkg, files) | ||
| 632 | msg= "Updated FILES_%s: %s for base images dir" % (pkg, d.getVar('FILES_%s' % pkg, files)) | ||
| 633 | bb.debug(2,msg) | ||
| 634 | #All the files and all sub directory leading up to the package image base directory | ||
| 635 | if conf_file: | ||
| 636 | rel_basedir = os.path.dirname(conf_file) | ||
| 637 | if rel_basedir.startswith(os.sep): | ||
| 638 | rel_basedir = rel_basedir[1:] | ||
| 639 | rel_basedir = os.path.join(pkg_imagedir, rel_basedir) | ||
| 640 | if re.search(rel_basedir, files) == None: | ||
| 641 | files = "%s %s" % ( files, rel_basedir) | ||
| 642 | files = "%s %s%s*" % ( files, rel_basedir, os.sep ) | ||
| 643 | while rel_basedir.count(os.sep) > 4: | ||
| 644 | #Must be above /etc/chef/etc/ | ||
| 645 | rel_basedir_list = rel_basedir.split(os.sep) | ||
| 646 | rel_basedir = os.sep.join(rel_basedir_list[:-1]) | ||
| 647 | if re.search(rel_basedir, files) == None: | ||
| 648 | #All the directory and files in it | ||
| 649 | files = "%s %s" % ( files, rel_basedir) | ||
| 650 | files = "%s %s%s*" % ( files, rel_basedir, os.sep ) | ||
| 651 | bb.note(files) | ||
| 652 | bb.debug(2, files) | ||
| 653 | d.setVar('FILES_%s' % pkg, files) | ||
| 654 | msg= "Updated FILES_%s: %s " % (pkg, d.getVar('FILES_%s' % pkg, files)) | ||
| 655 | bb.debug(2,msg) | ||
| 656 | |||
| 657 | def deploychef_update_FILES_PN_variable(d): | ||
| 658 | """Indicate that the created chef-solo templates should be packaged | ||
| 659 | |||
| 660 | This function ensures that all the templates files which are based off | ||
| 661 | of configuration files exposed to this class are packaged up when they | ||
| 662 | are copied from the images directory to the various packages folders | ||
| 663 | This avoids the QA warning such as: | ||
| 664 | WARNING: For recipe python-neutron, the following files/directories were installed | ||
| 665 | but not shipped in any package: | ||
| 666 | """ | ||
| 667 | conf_files = d.getVar('CHEF_SERVICES_CONF_FILES', True ) | ||
| 668 | if conf_files and len(conf_files.strip()): | ||
| 669 | import shutil | ||
| 670 | import os | ||
| 671 | for conf_file in conf_files.split(): | ||
| 672 | deploychef_add_file_to_FILES_PN(d, conf_file) | ||
| 673 | else: | ||
| 674 | #Add the directory containing the start/stop scripts | ||
| 675 | deploychef_add_file_to_FILES_PN(d) | ||
| 676 | |||
| 677 | |||
| 678 | python populate_packages_prepend() { | ||
| 679 | |||
| 680 | deploychef_update_FILES_PN_variable(d) | ||
| 681 | } | ||
| 682 | |||
| 683 | #The sets of functions below are for post rootfs processing. Preparing files | ||
| 684 | #for chefsolo is a two stage process. First we must create the required files | ||
| 685 | #in the package's image directory; and this is mostly done by the functions | ||
| 686 | #above. | ||
| 687 | #And then we aggregate the files from their respective package directories | ||
| 688 | #and put them together for the deploychef package in the expected | ||
| 689 | #location. | ||
| 690 | CHEF_ROOT_DIR="${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}" | ||
| 691 | CHEF_CONF_DIR="${CHEF_ROOT_DIR}/${sysconfdir}" | ||
| 692 | INITD_DIR="${IMAGE_ROOTFS}/${sysconfdir}/init.d" | ||
| 693 | POSTINSTS_DIR="${IMAGE_ROOTFS}/${sysconfdir}/rpm-postinsts" | ||
| 694 | DEPLOYCHEF_DIR="${IMAGE_ROOTFS}/opt/deploychef" | ||
| 695 | DEPLOYCHEF_TEMPLATES_DIR="${DEPLOYCHEF_DIR}/cookbooks/openstack/templates/default" | ||
| 696 | ATTRIBUTES_DIR="${DEPLOYCHEF_DIR}/cookbooks/openstack/attributes" | ||
| 697 | ATTRIBUTES_FILE="${ATTRIBUTES_DIR}/default.rb" | ||
| 698 | |||
| 699 | deploychef_copy_host_files() { | ||
| 700 | #The /etc/hosts & /etc/hostname files are written during the rootfs | ||
| 701 | #post process, therefore the only way of making templates out of them | ||
| 702 | #is to hook into the rootfs post process command. | ||
| 703 | if [ -f "${IMAGE_ROOTFS}/${sysconfdir}/hosts" ]; then | ||
| 704 | #Convert etc/hosts to chefsolo template | ||
| 705 | cp ${IMAGE_ROOTFS}/${sysconfdir}/hosts ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/${sysconfdir}/hosts.erb | ||
| 706 | sed -e "s,${CONTROLLER_IP},${ERB_PREFIX}CONTROLLER_IP${ERB_SUFFIX},g" -i \ | ||
| 707 | ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/${sysconfdir}/hosts.erb | ||
| 708 | sed -e "s,${CONTROLLER_HOST},${ERB_PREFIX}CONTROLLER_HOST${ERB_SUFFIX},g" -i \ | ||
| 709 | ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/${sysconfdir}/hosts.erb | ||
| 710 | |||
| 711 | sed -e "s,${COMPUTE_IP},${ERB_PREFIX}COMPUTE_IP${ERB_SUFFIX},g" -i \ | ||
| 712 | ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/${sysconfdir}/hosts.erb | ||
| 713 | sed -e "s,${COMPUTE_HOST},${ERB_PREFIX}COMPUTE_HOST${ERB_SUFFIX},g" -i \ | ||
| 714 | ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/${sysconfdir}/hosts.erb | ||
| 715 | #Create an attribute file for /etc/hosts | ||
| 716 | attr_string="${ERB_DEFAULT_PREFIX}\"COMPUTE_IP\"${ERB_DEFAULT_SUFFIX} = \"${COMPUTE_IP}\"" | ||
| 717 | echo "$attr_string" > ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/hosts-attributes.rb | ||
| 718 | attr_string="${ERB_DEFAULT_PREFIX}\"COMPUTE_HOST\"${ERB_DEFAULT_SUFFIX} = \"${COMPUTE_HOST}\"" | ||
| 719 | echo "$attr_string" >> ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/hosts-attributes.rb | ||
| 720 | attr_string="${ERB_DEFAULT_PREFIX}\"CONTROLLER_IP\"${ERB_DEFAULT_SUFFIX} = \"${CONTROLLER_IP}\"" | ||
| 721 | echo "$attr_string" >> ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/hosts-attributes.rb | ||
| 722 | attr_string="${ERB_DEFAULT_PREFIX}\"CONTROLLER_HOST\"${ERB_DEFAULT_SUFFIX} = \"${CONTROLLER_HOST}\"" | ||
| 723 | echo "$attr_string" >> ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/hosts-attributes.rb | ||
| 724 | fi | ||
| 725 | |||
| 726 | if [ -f "${IMAGE_ROOTFS}/${sysconfdir}/hostname" ]; then | ||
| 727 | #Convert etc/hostname to chefsolo template | ||
| 728 | cp ${IMAGE_ROOTFS}/${sysconfdir}/hostname ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/${sysconfdir}/hostname.erb | ||
| 729 | sed -e "s,${MY_HOST},${ERB_PREFIX}HOSTNAME${ERB_SUFFIX},g" -i \ | ||
| 730 | ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/${sysconfdir}/hostname.erb | ||
| 731 | #Create an attribute file for /etc/hostname | ||
| 732 | attr_string="${ERB_DEFAULT_PREFIX}\"HOSTNAME\"${ERB_DEFAULT_SUFFIX} = \"${MY_HOST}\"" | ||
| 733 | echo "$attr_string" > ${IMAGE_ROOTFS}/${sysconfdir}/${CHEFPN}/hostname-attributes.rb | ||
| 734 | fi | ||
| 735 | } | ||
| 736 | |||
| 737 | |||
| 738 | combine_services_daemons(){ | ||
| 739 | if [ -n $1 ]; then | ||
| 740 | file_suffix=$1 | ||
| 741 | rm -f ${DEPLOYCHEF_DIR}/$file_suffix | ||
| 742 | #combine the list of shutdown/startup scripts | ||
| 743 | find "${CHEF_ROOT_DIR}/" -name "*$file_suffix" 2> /dev/null | while read fname; do | ||
| 744 | service_cont=$(cat $fname) | ||
| 745 | for line in $service_cont; do | ||
| 746 | service=$(echo $line | awk -F"[SK][0-9]+" '{print $2}') | ||
| 747 | if [ -e ${INITD_DIR}/$service ]; then | ||
| 748 | echo $line >> ${DEPLOYCHEF_DIR}/$file_suffix | ||
| 749 | fi | ||
| 750 | done | ||
| 751 | done | ||
| 752 | fi | ||
| 753 | } | ||
| 754 | |||
| 755 | #This function combines the attributes of all the sevices into | ||
| 756 | #a default.rb attributes file. | ||
| 757 | combine_services_attributes(){ | ||
| 758 | file_suffix='attributes.rb' | ||
| 759 | mkdir -p ${ATTRIBUTES_DIR}; rm -f ${ATTRIBUTES_FILE} 2>/dev/null | ||
| 760 | #combine the list of shutdown/starup scripts | ||
| 761 | find "${CHEF_ROOT_DIR}/" -name "*$file_suffix" 2> /dev/null | \ | ||
| 762 | while read fname; do | ||
| 763 | cat $fname | while read line_in_file; do | ||
| 764 | index=$(echo $line_in_file | awk -F'"' '{print $2}') | ||
| 765 | #Only append attributes that are not in the default.rb attributes file | ||
| 766 | if [ ! `grep -l $index ${ATTRIBUTES_FILE}` ]; then | ||
| 767 | echo $line_in_file >> ${ATTRIBUTES_FILE} | ||
| 768 | fi | ||
| 769 | done | ||
| 770 | done | ||
| 771 | } | ||
| 772 | |||
| 773 | #This function copies the templates to deploychef directory from | ||
| 774 | #within the packages directories | ||
| 775 | copy_templates_in_place(){ | ||
| 776 | #copy rpm-postinsts and config templates into templates directory | ||
| 777 | mkdir -p ${DEPLOYCHEF_TEMPLATES_DIR} | ||
| 778 | #First copy all our configuration template files | ||
| 779 | if [ -d ${CHEF_CONF_DIR} ]; then | ||
| 780 | cp -rf ${CHEF_CONF_DIR} ${DEPLOYCHEF_TEMPLATES_DIR} | ||
| 781 | fi | ||
| 782 | #Now copy the rpm-postinsts files into cookbooks/templates/default/etc/ | ||
| 783 | if [ -d ${POSTINSTS_DIR} ]; then | ||
| 784 | cp -rf ${POSTINSTS_DIR} ${DEPLOYCHEF_TEMPLATES_DIR}/${sysconfdir} | ||
| 785 | #Move the files to base of the templates directory, where chef-solo | ||
| 786 | #expects them | ||
| 787 | cp -f ${POSTINSTS_DIR}/* ${DEPLOYCHEF_TEMPLATES_DIR}/. | ||
| 788 | fi | ||
| 789 | |||
| 790 | } | ||
| 791 | |||
| 792 | filter_node_dependent_templates(){ | ||
| 793 | if [ -d ${DEPLOYCHEF_TEMPLATES_DIR} ]; then | ||
| 794 | find "${DEPLOYCHEF_TEMPLATES_DIR}/" -name "*.erb*" 2> /dev/null | \ | ||
| 795 | while read fname; do | ||
| 796 | config_file=$(echo $fname | awk -F'/default' '{print $2}' | awk \ | ||
| 797 | -F'.erb' '{print $1}') | ||
| 798 | #If the base configuration file does not exist on this node | ||
| 799 | #remove it. | ||
| 800 | if [ ! -f ${IMAGE_ROOTFS}$config_file ]; then | ||
| 801 | rm -f "$fname" | ||
| 802 | else | ||
| 803 | #Move the file to the default template directory where | ||
| 804 | #chefsolo expect them | ||
| 805 | cp "$fname" "${DEPLOYCHEF_TEMPLATES_DIR}" | ||
| 806 | fi | ||
| 807 | done | ||
| 808 | fi | ||
| 809 | } | ||
| 810 | |||
| 811 | #This function is our post rootfs hook, it enables | ||
| 812 | #us to do what we wish to do during rootfs creation process. | ||
| 813 | deploychef_rootfs_postprocess_commands() { | ||
| 814 | |||
| 815 | if [ -n "${OPENSTACKCHEF_ENABLED}" ]; then | ||
| 816 | deploychef_copy_host_files | ||
| 817 | combine_services_daemons 'shutdown-list' | ||
| 818 | combine_services_daemons 'startup-list' | ||
| 819 | combine_services_attributes | ||
| 820 | copy_templates_in_place | ||
| 821 | filter_node_dependent_templates | ||
| 822 | else | ||
| 823 | #Let us delete the deploychef init script that runs | ||
| 824 | #chef-solo at boot-up from rootfs | ||
| 825 | rm -f ${INITD_DIR}/deploychef 2> /dev/null | ||
| 826 | fi | ||
| 827 | #We nolonger have need for /etc/${CHEFPN} directory on rootfs | ||
| 828 | #Not even at run-time | ||
| 829 | rm -rf "${CHEF_ROOT_DIR}" | ||
| 830 | } | ||
| 831 | |||
diff --git a/meta-openstack/recipes-devtools/python/python-barbican_git.bb b/meta-openstack/recipes-devtools/python/python-barbican_git.bb index c3b2896..0b3d768 100644 --- a/meta-openstack/recipes-devtools/python/python-barbican_git.bb +++ b/meta-openstack/recipes-devtools/python/python-barbican_git.bb | |||
| @@ -19,7 +19,7 @@ SRCREV = "e6f05febbe18a86e4e6b05acc5f4868fa3beb291" | |||
| 19 | PV = "2015.1.0+git${SRCPV}" | 19 | PV = "2015.1.0+git${SRCPV}" |
| 20 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
| 21 | 21 | ||
| 22 | inherit update-rc.d setuptools identity hosts useradd default_configs openstackchef monitor | 22 | inherit update-rc.d setuptools identity hosts useradd default_configs monitor |
| 23 | 23 | ||
| 24 | SERVICECREATE_PACKAGES = "${SRCNAME}-setup" | 24 | SERVICECREATE_PACKAGES = "${SRCNAME}-setup" |
| 25 | KEYSTONE_HOST="${CONTROLLER_IP}" | 25 | KEYSTONE_HOST="${CONTROLLER_IP}" |
| @@ -48,10 +48,8 @@ do_install_append() { | |||
| 48 | cp -r ${TEMPLATE_CONF_DIR}/* ${BARBICAN_CONF_DIR} | 48 | cp -r ${TEMPLATE_CONF_DIR}/* ${BARBICAN_CONF_DIR} |
| 49 | 49 | ||
| 50 | install -d ${D}${localstatedir}/lib/barbican | 50 | install -d ${D}${localstatedir}/lib/barbican |
| 51 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | 51 | sed -e "s:%BARBICAN_MAX_PACKET_SIZE%:${BARBICAN_MAX_PACKET_SIZE}:g" -i ${BARBICAN_CONF_DIR}/vassals/barbican-api.ini |
| 52 | sed -e "s:%BARBICAN_MAX_PACKET_SIZE%:${BARBICAN_MAX_PACKET_SIZE}:g" -i ${BARBICAN_CONF_DIR}/vassals/barbican-api.ini | 52 | sed -e "s:%BARBICAN_MAX_PACKET_SIZE%:${BARBICAN_MAX_PACKET_SIZE}:g" -i ${BARBICAN_CONF_DIR}/vassals/barbican-admin.ini |
| 53 | sed -e "s:%BARBICAN_MAX_PACKET_SIZE%:${BARBICAN_MAX_PACKET_SIZE}:g" -i ${BARBICAN_CONF_DIR}/vassals/barbican-admin.ini | ||
| 54 | fi | ||
| 55 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | 53 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 56 | install -d ${D}${sysconfdir}/init.d | 54 | install -d ${D}${sysconfdir}/init.d |
| 57 | 55 | ||
| @@ -68,10 +66,6 @@ do_install_append() { | |||
| 68 | -i ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/tests/api/test_resources_policy.py | 66 | -i ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/tests/api/test_resources_policy.py |
| 69 | } | 67 | } |
| 70 | 68 | ||
| 71 | CHEF_SERVICES_CONF_FILES :="\ | ||
| 72 | ${sysconfdir}/${SRCNAME}/vassals/barbican-api.ini \ | ||
| 73 | ${sysconfdir}/${SRCNAME}/vassals/barbican-admin.ini \ | ||
| 74 | " | ||
| 75 | USERADD_PACKAGES = "${PN}" | 69 | USERADD_PACKAGES = "${PN}" |
| 76 | GROUPADD_PARAM_${PN} = "--system barbican" | 70 | GROUPADD_PARAM_${PN} = "--system barbican" |
| 77 | USERADD_PARAM_${PN} = "--system --home /var/lib/barbican -g barbican \ | 71 | USERADD_PARAM_${PN} = "--system --home /var/lib/barbican -g barbican \ |
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb index 0d6e2d3..5645626 100644 --- a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb +++ b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb | |||
| @@ -63,21 +63,20 @@ do_install_append() { | |||
| 63 | install -m 600 ${TEMPLATE_CONF_DIR}/*.yaml ${CEILOMETER_CONF_DIR} | 63 | install -m 600 ${TEMPLATE_CONF_DIR}/*.yaml ${CEILOMETER_CONF_DIR} |
| 64 | 64 | ||
| 65 | install -m 600 ${TEMPLATE_CONF_DIR}/api_paste.ini ${CEILOMETER_CONF_DIR} | 65 | install -m 600 ${TEMPLATE_CONF_DIR}/api_paste.ini ${CEILOMETER_CONF_DIR} |
| 66 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | 66 | sed -e "s:%CEILOMETER_SECRET%:${CEILOMETER_SECRET}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf |
| 67 | sed -e "s:%CEILOMETER_SECRET%:${CEILOMETER_SECRET}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | ||
| 68 | 67 | ||
| 69 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | 68 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf |
| 70 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | 69 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf |
| 71 | 70 | ||
| 72 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | 71 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf |
| 73 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | 72 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf |
| 74 | 73 | ||
| 75 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | 74 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf |
| 76 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | 75 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf |
| 76 | |||
| 77 | sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | ||
| 78 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | ||
| 77 | 79 | ||
| 78 | sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | ||
| 79 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf | ||
| 80 | fi | ||
| 81 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | 80 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 82 | install -d ${D}${sysconfdir}/init.d | 81 | install -d ${D}${sysconfdir}/init.d |
| 83 | 82 | ||
| @@ -108,9 +107,6 @@ do_install_append() { | |||
| 108 | fi | 107 | fi |
| 109 | } | 108 | } |
| 110 | 109 | ||
| 111 | CHEF_SERVICES_CONF_FILES :="\ | ||
| 112 | ${sysconfdir}/${SRCNAME}/ceilometer.conf \ | ||
| 113 | " | ||
| 114 | pkg_postinst_${SRCNAME}-setup () { | 110 | pkg_postinst_${SRCNAME}-setup () { |
| 115 | if [ "x$D" != "x" ]; then | 111 | if [ "x$D" != "x" ]; then |
| 116 | exit 1 | 112 | exit 1 |
| @@ -128,7 +124,7 @@ pkg_postinst_${SRCNAME}-setup () { | |||
| 128 | ceilometer-dbsync | 124 | ceilometer-dbsync |
| 129 | } | 125 | } |
| 130 | 126 | ||
| 131 | inherit setuptools identity hosts update-rc.d default_configs openstackchef monitor | 127 | inherit setuptools identity hosts update-rc.d default_configs monitor |
| 132 | 128 | ||
| 133 | PACKAGES += " ${SRCNAME}-tests" | 129 | PACKAGES += " ${SRCNAME}-tests" |
| 134 | PACKAGES += "${SRCNAME}-setup ${SRCNAME}-common ${SRCNAME}-api" | 130 | PACKAGES += "${SRCNAME}-setup ${SRCNAME}-common ${SRCNAME}-api" |
diff --git a/meta-openstack/recipes-devtools/python/python-cinder_git.bb b/meta-openstack/recipes-devtools/python/python-cinder_git.bb index 91098c4..e70a3aa 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder_git.bb +++ b/meta-openstack/recipes-devtools/python/python-cinder_git.bb | |||
| @@ -24,7 +24,7 @@ SRCREV = "61026d4e4f2a58dd84ffb2e4e40ab99860b9316a" | |||
| 24 | PV = "7.0.0+git${SRCPV}" | 24 | PV = "7.0.0+git${SRCPV}" |
| 25 | S = "${WORKDIR}/git" | 25 | S = "${WORKDIR}/git" |
| 26 | 26 | ||
| 27 | inherit setuptools update-rc.d identity default_configs hosts openstackchef monitor | 27 | inherit setuptools update-rc.d identity default_configs hosts monitor |
| 28 | 28 | ||
| 29 | CINDER_BACKUP_BACKEND_DRIVER ?= "cinder.backup.drivers.swift" | 29 | CINDER_BACKUP_BACKEND_DRIVER ?= "cinder.backup.drivers.swift" |
| 30 | 30 | ||
| @@ -77,8 +77,7 @@ do_install_append() { | |||
| 77 | 77 | ||
| 78 | install -d ${D}${localstatedir}/log/${SRCNAME} | 78 | install -d ${D}${localstatedir}/log/${SRCNAME} |
| 79 | 79 | ||
| 80 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | 80 | for file in api-paste.ini cinder.conf; do |
| 81 | for file in api-paste.ini cinder.conf; do | ||
| 82 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | 81 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ |
| 83 | -i ${CINDER_CONF_DIR}/$file | 82 | -i ${CINDER_CONF_DIR}/$file |
| 84 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${CINDER_CONF_DIR}/$file | 83 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${CINDER_CONF_DIR}/$file |
| @@ -89,8 +88,7 @@ do_install_append() { | |||
| 89 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${CINDER_CONF_DIR}/$file | 88 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${CINDER_CONF_DIR}/$file |
| 90 | sed -e "s:%CINDER_BACKUP_BACKEND_DRIVER%:${CINDER_BACKUP_BACKEND_DRIVER}:g" \ | 89 | sed -e "s:%CINDER_BACKUP_BACKEND_DRIVER%:${CINDER_BACKUP_BACKEND_DRIVER}:g" \ |
| 91 | -i ${CINDER_CONF_DIR}/$file | 90 | -i ${CINDER_CONF_DIR}/$file |
| 92 | done | 91 | done |
| 93 | fi | ||
| 94 | 92 | ||
| 95 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | 93 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 96 | install -d ${D}${sysconfdir}/init.d | 94 | install -d ${D}${sysconfdir}/init.d |
| @@ -125,10 +123,6 @@ do_install_append() { | |||
| 125 | sed -e "s:%IS_DEFAULT%:${is_default}:g" -i ${D}/etc/cinder/drivers/glusterfs_setup.sh | 123 | sed -e "s:%IS_DEFAULT%:${is_default}:g" -i ${D}/etc/cinder/drivers/glusterfs_setup.sh |
| 126 | } | 124 | } |
| 127 | 125 | ||
| 128 | CHEF_SERVICES_CONF_FILES :="\ | ||
| 129 | ${sysconfdir}/${SRCNAME}/cinder.conf \ | ||
| 130 | ${sysconfdir}/${SRCNAME}/api-paste.ini \ | ||
| 131 | " | ||
| 132 | pkg_postinst_${SRCNAME}-setup () { | 126 | pkg_postinst_${SRCNAME}-setup () { |
| 133 | if [ "x$D" != "x" ]; then | 127 | if [ "x$D" != "x" ]; then |
| 134 | exit 1 | 128 | exit 1 |
diff --git a/meta-openstack/recipes-devtools/python/python-glance_git.bb b/meta-openstack/recipes-devtools/python/python-glance_git.bb index bce373d..27c33b9 100644 --- a/meta-openstack/recipes-devtools/python/python-glance_git.bb +++ b/meta-openstack/recipes-devtools/python/python-glance_git.bb | |||
| @@ -18,7 +18,7 @@ PV = "11.0.0+git${SRCPV}" | |||
| 18 | 18 | ||
| 19 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
| 20 | 20 | ||
| 21 | inherit setuptools update-rc.d identity default_configs hosts openstackchef monitor | 21 | inherit setuptools update-rc.d identity default_configs hosts monitor |
| 22 | 22 | ||
| 23 | GLANCE_DEFAULT_STORE ?= "file" | 23 | GLANCE_DEFAULT_STORE ?= "file" |
| 24 | GLANCE_KNOWN_STORES ?= "glance.store.rbd.Store,\ | 24 | GLANCE_KNOWN_STORES ?= "glance.store.rbd.Store,\ |
| @@ -97,20 +97,18 @@ do_install_append() { | |||
| 97 | 97 | ||
| 98 | install -d ${D}${localstatedir}/log/${SRCNAME} | 98 | install -d ${D}${localstatedir}/log/${SRCNAME} |
| 99 | 99 | ||
| 100 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | 100 | for file in api registry cache |
| 101 | for file in api registry cache | 101 | do |
| 102 | do | 102 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ |
| 103 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | 103 | -i ${GLANCE_CONF_DIR}/glance-$file.conf |
| 104 | -i ${GLANCE_CONF_DIR}/glance-$file.conf | 104 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${GLANCE_CONF_DIR}/glance-$file.conf |
| 105 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${GLANCE_CONF_DIR}/glance-$file.conf | 105 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ |
| 106 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | 106 | -i ${GLANCE_CONF_DIR}/glance-$file.conf |
| 107 | -i ${GLANCE_CONF_DIR}/glance-$file.conf | 107 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" \ |
| 108 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" \ | 108 | -i ${GLANCE_CONF_DIR}/glance-$file.conf |
| 109 | -i ${GLANCE_CONF_DIR}/glance-$file.conf | 109 | sed -e "s:%DB_USER%:${DB_USER}:g" \ |
| 110 | sed -e "s:%DB_USER%:${DB_USER}:g" \ | 110 | -i ${GLANCE_CONF_DIR}/glance-$file.conf |
| 111 | -i ${GLANCE_CONF_DIR}/glance-$file.conf | 111 | done |
| 112 | done | ||
| 113 | fi | ||
| 114 | 112 | ||
| 115 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | 113 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 116 | install -d ${D}${sysconfdir}/init.d | 114 | install -d ${D}${sysconfdir}/init.d |
| @@ -123,12 +121,6 @@ do_install_append() { | |||
| 123 | cp run_tests.sh ${GLANCE_CONF_DIR} | 121 | cp run_tests.sh ${GLANCE_CONF_DIR} |
| 124 | } | 122 | } |
| 125 | 123 | ||
| 126 | CHEF_SERVICES_CONF_FILES := "\ | ||
| 127 | ${sysconfdir}/${SRCNAME}/glance-api.conf \ | ||
| 128 | ${sysconfdir}/${SRCNAME}/glance-cache.conf \ | ||
| 129 | ${sysconfdir}/${SRCNAME}/glance-registry.conf \ | ||
| 130 | " | ||
| 131 | |||
| 132 | pkg_postinst_${SRCNAME}-setup () { | 124 | pkg_postinst_${SRCNAME}-setup () { |
| 133 | if [ "x$D" != "x" ]; then | 125 | if [ "x$D" != "x" ]; then |
| 134 | exit 1 | 126 | exit 1 |
diff --git a/meta-openstack/recipes-devtools/python/python-heat_git.bb b/meta-openstack/recipes-devtools/python/python-heat_git.bb index 75d5ba6..6da768f 100644 --- a/meta-openstack/recipes-devtools/python/python-heat_git.bb +++ b/meta-openstack/recipes-devtools/python/python-heat_git.bb | |||
| @@ -70,25 +70,24 @@ do_install_append() { | |||
| 70 | install -d ${HEAT_CONF_DIR}/environment.d | 70 | install -d ${HEAT_CONF_DIR}/environment.d |
| 71 | install -m 600 ${TEMPLATE_CONF_DIR}/environment.d/* ${HEAT_CONF_DIR}/environment.d | 71 | install -m 600 ${TEMPLATE_CONF_DIR}/environment.d/* ${HEAT_CONF_DIR}/environment.d |
| 72 | install -m 664 ${TEMPLATE_CONF_DIR}/api-paste.ini ${HEAT_CONF_DIR} | 72 | install -m 664 ${TEMPLATE_CONF_DIR}/api-paste.ini ${HEAT_CONF_DIR} |
| 73 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | 73 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ |
| 74 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | 74 | -i ${HEAT_CONF_DIR}/api-paste.ini |
| 75 | -i ${HEAT_CONF_DIR}/api-paste.ini | 75 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${HEAT_CONF_DIR}/api-paste.ini |
| 76 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${HEAT_CONF_DIR}/api-paste.ini | 76 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${HEAT_CONF_DIR}/api-paste.ini |
| 77 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${HEAT_CONF_DIR}/api-paste.ini | 77 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/api-paste.ini |
| 78 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/api-paste.ini | ||
| 79 | 78 | ||
| 80 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${HEAT_CONF_DIR}/heat.conf | 79 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${HEAT_CONF_DIR}/heat.conf |
| 81 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf | 80 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf |
| 82 | 81 | ||
| 83 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf | 82 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf |
| 84 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf | 83 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf |
| 85 | 84 | ||
| 86 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf | 85 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf |
| 87 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf | 86 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf |
| 87 | |||
| 88 | sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf | ||
| 89 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${HEAT_CONF_DIR}/heat.conf | ||
| 88 | 90 | ||
| 89 | sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf | ||
| 90 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${HEAT_CONF_DIR}/heat.conf | ||
| 91 | fi | ||
| 92 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | 91 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 93 | install -d ${D}${sysconfdir}/init.d | 92 | install -d ${D}${sysconfdir}/init.d |
| 94 | 93 | ||
| @@ -107,10 +106,6 @@ do_install_append() { | |||
| 107 | fi | 106 | fi |
| 108 | } | 107 | } |
| 109 | 108 | ||
| 110 | CHEF_SERVICES_CONF_FILES :="\ | ||
| 111 | ${sysconfdir}/${SRCNAME}/heat.conf \ | ||
| 112 | ${sysconfdir}/${SRCNAME}/api-paste.ini \ | ||
| 113 | " | ||
| 114 | pkg_postinst_${SRCNAME}-setup () { | 109 | pkg_postinst_${SRCNAME}-setup () { |
| 115 | if [ "x$D" != "x" ]; then | 110 | if [ "x$D" != "x" ]; then |
| 116 | exit 1 | 111 | exit 1 |
| @@ -128,7 +123,7 @@ pkg_postinst_${SRCNAME}-setup () { | |||
| 128 | heat-manage db_sync | 123 | heat-manage db_sync |
| 129 | } | 124 | } |
| 130 | 125 | ||
| 131 | inherit setuptools identity hosts update-rc.d default_configs openstackchef monitor | 126 | inherit setuptools identity hosts update-rc.d default_configs monitor |
| 132 | 127 | ||
| 133 | PACKAGES += "${SRCNAME}-tests ${SRCNAME}-templates ${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine" | 128 | PACKAGES += "${SRCNAME}-tests ${SRCNAME}-templates ${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine" |
| 134 | PACKAGES += "${SRCNAME}-setup" | 129 | PACKAGES += "${SRCNAME}-setup" |
diff --git a/meta-openstack/recipes-devtools/python/python-horizon_git.bb b/meta-openstack/recipes-devtools/python/python-horizon_git.bb index 61d31da..d2cb345 100644 --- a/meta-openstack/recipes-devtools/python/python-horizon_git.bb +++ b/meta-openstack/recipes-devtools/python/python-horizon_git.bb | |||
| @@ -84,7 +84,7 @@ SRCREV = "593f0b78eea8efbb6d833d66acc7ab4dc852159b" | |||
| 84 | PV = "8.0.0+git${SRCPV}" | 84 | PV = "8.0.0+git${SRCPV}" |
| 85 | S = "${WORKDIR}/git" | 85 | S = "${WORKDIR}/git" |
| 86 | 86 | ||
| 87 | inherit setuptools update-rc.d python-dir default_configs openstackchef monitor | 87 | inherit setuptools update-rc.d python-dir default_configs monitor |
| 88 | 88 | ||
| 89 | # no longer required. kept as reference. | 89 | # no longer required. kept as reference. |
| 90 | # do_install[dirs] += "${D}/usr/share/bin" | 90 | # do_install[dirs] += "${D}/usr/share/bin" |
diff --git a/meta-openstack/recipes-devtools/python/python-keystone_git.bb b/meta-openstack/recipes-devtools/python/python-keystone_git.bb index e79a6a4..49aa530 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone_git.bb +++ b/meta-openstack/recipes-devtools/python/python-keystone_git.bb | |||
| @@ -24,7 +24,7 @@ PV = "8.0.0+git${SRCPV}" | |||
| 24 | 24 | ||
| 25 | S = "${WORKDIR}/git" | 25 | S = "${WORKDIR}/git" |
| 26 | 26 | ||
| 27 | inherit setuptools update-rc.d identity hosts default_configs openstackchef monitor | 27 | inherit setuptools update-rc.d identity hosts default_configs monitor |
| 28 | 28 | ||
| 29 | SERVICE_TOKEN = "password" | 29 | SERVICE_TOKEN = "password" |
| 30 | TOKEN_FORMAT ?= "PKI" | 30 | TOKEN_FORMAT ?= "PKI" |
| @@ -114,28 +114,26 @@ do_install_append() { | |||
| 114 | admin_endpoint = http://%CONTROLLER_IP%:8081/keystone/admin/ " \ | 114 | admin_endpoint = http://%CONTROLLER_IP%:8081/keystone/admin/ " \ |
| 115 | -i ${KEYSTONE_CONF_DIR}/keystone.conf | 115 | -i ${KEYSTONE_CONF_DIR}/keystone.conf |
| 116 | 116 | ||
| 117 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | 117 | sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" \ |
| 118 | sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" \ | 118 | -i ${KEYSTONE_CONF_DIR}/keystone.conf |
| 119 | -i ${KEYSTONE_CONF_DIR}/keystone.conf | 119 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${KEYSTONE_CONF_DIR}/keystone.conf |
| 120 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${KEYSTONE_CONF_DIR}/keystone.conf | 120 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" \ |
| 121 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" \ | 121 | -i ${KEYSTONE_CONF_DIR}/keystone.conf |
| 122 | -i ${KEYSTONE_CONF_DIR}/keystone.conf | 122 | |
| 123 | 123 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" \ | |
| 124 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" \ | 124 | -i ${KEYSTONE_CONF_DIR}/keystone.conf |
| 125 | -i ${KEYSTONE_CONF_DIR}/keystone.conf | 125 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" \ |
| 126 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" \ | 126 | -i ${KEYSTONE_CONF_DIR}/identity.sh |
| 127 | -i ${KEYSTONE_CONF_DIR}/identity.sh | 127 | |
| 128 | 128 | sed -e "s:%TOKEN_FORMAT%:${TOKEN_FORMAT}:g" \ | |
| 129 | sed -e "s:%TOKEN_FORMAT%:${TOKEN_FORMAT}:g" \ | 129 | -i ${KEYSTONE_CONF_DIR}/keystone.conf |
| 130 | -i ${KEYSTONE_CONF_DIR}/keystone.conf | 130 | |
| 131 | 131 | sed -e "s/%ADMIN_PASSWORD%/${ADMIN_PASSWORD}/g" \ | |
| 132 | sed -e "s/%ADMIN_PASSWORD%/${ADMIN_PASSWORD}/g" \ | 132 | -i ${D}${sysconfdir}/init.d/keystone |
| 133 | -i ${D}${sysconfdir}/init.d/keystone | 133 | sed -e "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" \ |
| 134 | sed -e "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" \ | 134 | -i ${D}${sysconfdir}/init.d/keystone |
| 135 | -i ${D}${sysconfdir}/init.d/keystone | 135 | sed -e "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" \ |
| 136 | sed -e "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" \ | 136 | -i ${D}${sysconfdir}/init.d/keystone |
| 137 | -i ${D}${sysconfdir}/init.d/keystone | ||
| 138 | fi | ||
| 139 | 137 | ||
| 140 | install -d ${KEYSTONE_PACKAGE_DIR}/tests/tmp | 138 | install -d ${KEYSTONE_PACKAGE_DIR}/tests/tmp |
| 141 | 139 | ||
| @@ -189,12 +187,6 @@ role_tree_dn = ou=Roles,${LDAP_DN} \ | |||
| 189 | fi | 187 | fi |
| 190 | } | 188 | } |
| 191 | 189 | ||
| 192 | CHEF_SERVICES_CONF_FILES := "\ | ||
| 193 | ${sysconfdir}/${SRCNAME}/keystone.conf \ | ||
| 194 | ${sysconfdir}/${SRCNAME}/identity.sh \ | ||
| 195 | ${sysconfdir}/init.d/keystone \ | ||
| 196 | " | ||
| 197 | |||
| 198 | pkg_postinst_${SRCNAME}-setup () { | 190 | pkg_postinst_${SRCNAME}-setup () { |
| 199 | # python-keystone postinst start | 191 | # python-keystone postinst start |
| 200 | if [ "x$D" != "x" ]; then | 192 | if [ "x$D" != "x" ]; then |
diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb index f651a8f..51c2ac4 100644 --- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb +++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb | |||
| @@ -24,7 +24,7 @@ PV = "7.0.0+git${SRCPV}" | |||
| 24 | 24 | ||
| 25 | S = "${WORKDIR}/git" | 25 | S = "${WORKDIR}/git" |
| 26 | 26 | ||
| 27 | inherit setuptools update-rc.d identity hosts default_configs openstackchef monitor | 27 | inherit setuptools update-rc.d identity hosts default_configs monitor |
| 28 | 28 | ||
| 29 | SERVICECREATE_PACKAGES = "${SRCNAME}-setup" | 29 | SERVICECREATE_PACKAGES = "${SRCNAME}-setup" |
| 30 | KEYSTONE_HOST="${CONTROLLER_IP}" | 30 | KEYSTONE_HOST="${CONTROLLER_IP}" |
| @@ -117,8 +117,8 @@ do_install_append() { | |||
| 117 | install -m 0755 ${WORKDIR}/neutron-$AGENT.init.sh ${D}${sysconfdir}/init.d/neutron-$AGENT-agent | 117 | install -m 0755 ${WORKDIR}/neutron-$AGENT.init.sh ${D}${sysconfdir}/init.d/neutron-$AGENT-agent |
| 118 | install -m 600 ${WORKDIR}/${AGENT}_agent.ini ${NEUTRON_CONF_DIR}/ | 118 | install -m 600 ${WORKDIR}/${AGENT}_agent.ini ${NEUTRON_CONF_DIR}/ |
| 119 | fi | 119 | fi |
| 120 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | 120 | |
| 121 | for file in plugins/ml2/ml2_conf.ini neutron.conf metadata_agent.ini; do | 121 | for file in plugins/ml2/ml2_conf.ini neutron.conf metadata_agent.ini; do |
| 122 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${NEUTRON_CONF_DIR}/$file | 122 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${NEUTRON_CONF_DIR}/$file |
| 123 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NEUTRON_CONF_DIR}/$file | 123 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NEUTRON_CONF_DIR}/$file |
| 124 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${NEUTRON_CONF_DIR}/$file | 124 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${NEUTRON_CONF_DIR}/$file |
| @@ -127,8 +127,8 @@ do_install_append() { | |||
| 127 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${NEUTRON_CONF_DIR}/$file | 127 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${NEUTRON_CONF_DIR}/$file |
| 128 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NEUTRON_CONF_DIR}/$file | 128 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NEUTRON_CONF_DIR}/$file |
| 129 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NEUTRON_CONF_DIR}/$file | 129 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NEUTRON_CONF_DIR}/$file |
| 130 | done | 130 | done |
| 131 | fi | 131 | |
| 132 | sed -e "s:^auth_host.*:#auth_host:g" -i ${NEUTRON_CONF_DIR}/neutron.conf | 132 | sed -e "s:^auth_host.*:#auth_host:g" -i ${NEUTRON_CONF_DIR}/neutron.conf |
| 133 | sed -e "s:^auth_port.*:#auth_port:g" -i ${NEUTRON_CONF_DIR}/neutron.conf | 133 | sed -e "s:^auth_port.*:#auth_port:g" -i ${NEUTRON_CONF_DIR}/neutron.conf |
| 134 | sed -e "s:^auth_protocol.*:#auth_protocol:g" -i ${NEUTRON_CONF_DIR}/neutron.conf | 134 | sed -e "s:^auth_protocol.*:#auth_protocol:g" -i ${NEUTRON_CONF_DIR}/neutron.conf |
| @@ -154,24 +154,6 @@ pkg_postinst_${SRCNAME}-setup () { | |||
| 154 | --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head | 154 | --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | CHEF_SERVICES_CONF_FILES := " \ | ||
| 158 | ${sysconfdir}/${SRCNAME}/neutron.conf \ | ||
| 159 | ${sysconfdir}/${SRCNAME}/metadata_agent.ini \ | ||
| 160 | ${sysconfdir}/${SRCNAME}/plugins/ml2/ml2_conf.ini \ | ||
| 161 | " | ||
| 162 | deploychef_services_special_func(){ | ||
| 163 | #This function is a callback function for the deploychef .bbclass | ||
| 164 | #We define this special callback funtion because we are doing | ||
| 165 | #more than a placeholder substitution. The variable CHEF_SERVICES_FILE_NAME | ||
| 166 | #is defined in deploychef_framework.bbclass | ||
| 167 | if [ -n "${CHEF_SERVICES_FILE_NAME}" ]; then | ||
| 168 | sed "s:^# rabbit_host =.*:rabbit_host = %CONTROLLER_IP%:" -i \ | ||
| 169 | ${CHEF_SERVICES_FILE_NAME} | ||
| 170 | fi | ||
| 171 | } | ||
| 172 | |||
| 173 | CHEF_SERVICES_SPECIAL_FUNC := "deploychef_services_special_func" | ||
| 174 | |||
| 175 | pkg_postinst_${SRCNAME}-plugin-openvswitch-setup () { | 157 | pkg_postinst_${SRCNAME}-plugin-openvswitch-setup () { |
| 176 | if [ "x$D" != "x" ]; then | 158 | if [ "x$D" != "x" ]; then |
| 177 | exit 1 | 159 | exit 1 |
diff --git a/meta-openstack/recipes-devtools/python/python-nova_git.bb b/meta-openstack/recipes-devtools/python/python-nova_git.bb index 7e0e861..c1f4de1 100644 --- a/meta-openstack/recipes-devtools/python/python-nova_git.bb +++ b/meta-openstack/recipes-devtools/python/python-nova_git.bb | |||
| @@ -30,7 +30,7 @@ PV = "12.0.0+git${SRCPV}" | |||
| 30 | 30 | ||
| 31 | S = "${WORKDIR}/git" | 31 | S = "${WORKDIR}/git" |
| 32 | 32 | ||
| 33 | inherit update-rc.d setuptools identity hosts useradd default_configs openstackchef monitor | 33 | inherit update-rc.d setuptools identity hosts useradd default_configs monitor |
| 34 | 34 | ||
| 35 | LIBVIRT_IMAGES_TYPE ?= "default" | 35 | LIBVIRT_IMAGES_TYPE ?= "default" |
| 36 | 36 | ||
| @@ -103,38 +103,38 @@ do_install_append() { | |||
| 103 | install -o nova -m 664 ${WORKDIR}/nova.conf ${NOVA_CONF_DIR}/nova.conf | 103 | install -o nova -m 664 ${WORKDIR}/nova.conf ${NOVA_CONF_DIR}/nova.conf |
| 104 | install -o nova -m 664 ${TEMPLATE_CONF_DIR}/api-paste.ini ${NOVA_CONF_DIR} | 104 | install -o nova -m 664 ${TEMPLATE_CONF_DIR}/api-paste.ini ${NOVA_CONF_DIR} |
| 105 | install -o nova -m 664 ${WORKDIR}/openrc ${NOVA_CONF_DIR} | 105 | install -o nova -m 664 ${WORKDIR}/openrc ${NOVA_CONF_DIR} |
| 106 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | ||
| 107 | # Configuration options | ||
| 108 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | ||
| 109 | -i ${NOVA_CONF_DIR}/api-paste.ini | ||
| 110 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NOVA_CONF_DIR}/api-paste.ini | ||
| 111 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | ||
| 112 | -i ${NOVA_CONF_DIR}/api-paste.ini | ||
| 113 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/api-paste.ini | ||
| 114 | 106 | ||
| 115 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${NOVA_CONF_DIR}/nova.conf | 107 | # Configuration options |
| 116 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${NOVA_CONF_DIR}/nova.conf | 108 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ |
| 109 | -i ${NOVA_CONF_DIR}/api-paste.ini | ||
| 110 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NOVA_CONF_DIR}/api-paste.ini | ||
| 111 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | ||
| 112 | -i ${NOVA_CONF_DIR}/api-paste.ini | ||
| 113 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/api-paste.ini | ||
| 117 | 114 | ||
| 118 | sed -e "s:%METADATA_SHARED_SECRET%:${METADATA_SHARED_SECRET}:g" -i ${NOVA_CONF_DIR}/nova.conf | 115 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${NOVA_CONF_DIR}/nova.conf |
| 116 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${NOVA_CONF_DIR}/nova.conf | ||
| 119 | 117 | ||
| 120 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/nova.conf | 118 | sed -e "s:%METADATA_SHARED_SECRET%:${METADATA_SHARED_SECRET}:g" -i ${NOVA_CONF_DIR}/nova.conf |
| 121 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NOVA_CONF_DIR}/nova.conf | ||
| 122 | 119 | ||
| 123 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${NOVA_CONF_DIR}/nova.conf | 120 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/nova.conf |
| 124 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${NOVA_CONF_DIR}/nova.conf | 121 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NOVA_CONF_DIR}/nova.conf |
| 125 | 122 | ||
| 126 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${NOVA_CONF_DIR}/nova.conf | 123 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${NOVA_CONF_DIR}/nova.conf |
| 127 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NOVA_CONF_DIR}/nova.conf | 124 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${NOVA_CONF_DIR}/nova.conf |
| 128 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${NOVA_CONF_DIR}/nova.conf | ||
| 129 | 125 | ||
| 130 | sed -e "s:%LIBVIRT_IMAGES_TYPE%:${LIBVIRT_IMAGES_TYPE}:g" -i ${NOVA_CONF_DIR}/nova.conf | 126 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${NOVA_CONF_DIR}/nova.conf |
| 127 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NOVA_CONF_DIR}/nova.conf | ||
| 128 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${NOVA_CONF_DIR}/nova.conf | ||
| 131 | 129 | ||
| 132 | sed -e "s:%OS_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${NOVA_CONF_DIR}/openrc | 130 | sed -e "s:%LIBVIRT_IMAGES_TYPE%:${LIBVIRT_IMAGES_TYPE}:g" -i ${NOVA_CONF_DIR}/nova.conf |
| 133 | sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${NOVA_CONF_DIR}/openrc | 131 | |
| 132 | sed -e "s:%OS_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${NOVA_CONF_DIR}/openrc | ||
| 133 | sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${NOVA_CONF_DIR}/openrc | ||
| 134 | |||
| 135 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/openrc | ||
| 136 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NOVA_CONF_DIR}/openrc | ||
| 134 | 137 | ||
| 135 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NOVA_CONF_DIR}/openrc | ||
| 136 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NOVA_CONF_DIR}/openrc | ||
| 137 | fi | ||
| 138 | install -o nova -d ${NOVA_CONF_DIR}/instances | 138 | install -o nova -d ${NOVA_CONF_DIR}/instances |
| 139 | 139 | ||
| 140 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | 140 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| @@ -159,12 +159,6 @@ do_install_append() { | |||
| 159 | cp -r "${S}/plugins" "${D}/${PYTHON_SITEPACKAGES_DIR}/nova" | 159 | cp -r "${S}/plugins" "${D}/${PYTHON_SITEPACKAGES_DIR}/nova" |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | CHEF_SERVICES_CONF_FILES := "\ | ||
| 163 | ${sysconfdir}/${SRCNAME}/nova.conf \ | ||
| 164 | ${sysconfdir}/${SRCNAME}/api-paste.ini \ | ||
| 165 | ${sysconfdir}/${SRCNAME}/openrc \ | ||
| 166 | " | ||
| 167 | |||
| 168 | pkg_postinst_${SRCNAME}-setup () { | 162 | pkg_postinst_${SRCNAME}-setup () { |
| 169 | if [ "x$D" != "x" ]; then | 163 | if [ "x$D" != "x" ]; then |
| 170 | exit 1 | 164 | exit 1 |
diff --git a/meta-openstack/recipes-devtools/python/python-swift_git.bb b/meta-openstack/recipes-devtools/python/python-swift_git.bb index 7862251..8552ea7 100644 --- a/meta-openstack/recipes-devtools/python/python-swift_git.bb +++ b/meta-openstack/recipes-devtools/python/python-swift_git.bb | |||
| @@ -20,7 +20,7 @@ SRCREV="4ca08cc395e686265574366497a6869e94eebcb2" | |||
| 20 | PV="2.2.2+git${SRCPV}" | 20 | PV="2.2.2+git${SRCPV}" |
| 21 | S = "${WORKDIR}/git" | 21 | S = "${WORKDIR}/git" |
| 22 | 22 | ||
| 23 | inherit setuptools python-dir update-rc.d hosts identity openstackchef | 23 | inherit setuptools python-dir update-rc.d hosts identity |
| 24 | 24 | ||
| 25 | # The size of the backing file (in Gigabytes) of loopback devices | 25 | # The size of the backing file (in Gigabytes) of loopback devices |
| 26 | # which are used for setting up Swift storage devices. The value | 26 | # which are used for setting up Swift storage devices. The value |
| @@ -82,39 +82,32 @@ do_install_append() { | |||
| 82 | sed 's/^# swift_dir =.*/swift_dir = \/etc\/swift/' -i ${SWIFT_CONF_DIR}/object-server.conf | 82 | sed 's/^# swift_dir =.*/swift_dir = \/etc\/swift/' -i ${SWIFT_CONF_DIR}/object-server.conf |
| 83 | sed 's/^# devices =.*/devices = \/etc\/swift\/node/' -i ${SWIFT_CONF_DIR}/object-server.conf | 83 | sed 's/^# devices =.*/devices = \/etc\/swift\/node/' -i ${SWIFT_CONF_DIR}/object-server.conf |
| 84 | sed 's/^# mount_check =.*/mount_check = false/' -i ${SWIFT_CONF_DIR}/object-server.conf | 84 | sed 's/^# mount_check =.*/mount_check = false/' -i ${SWIFT_CONF_DIR}/object-server.conf |
| 85 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | 85 | |
| 86 | sed "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" -i ${SWIFT_CONF_DIR}/proxy-server.conf | 86 | sed "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" -i ${SWIFT_CONF_DIR}/proxy-server.conf |
| 87 | sed "s/%SERVICE_USER%/${SRCNAME}/g" -i ${SWIFT_CONF_DIR}/proxy-server.conf | 87 | sed "s/%SERVICE_USER%/${SRCNAME}/g" -i ${SWIFT_CONF_DIR}/proxy-server.conf |
| 88 | sed "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/proxy-server.conf | 88 | sed "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/proxy-server.conf |
| 89 | 89 | ||
| 90 | sed "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf | 90 | sed "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf |
| 91 | sed "s/%SERVICE_USER%/${SRCNAME}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf | 91 | sed "s/%SERVICE_USER%/${SRCNAME}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf |
| 92 | sed "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf | 92 | sed "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf |
| 93 | 93 | ||
| 94 | sed "s/%ADMIN_TENANT_NAME%/admin/g" -i ${SWIFT_CONF_DIR}/test.conf | 94 | sed "s/%ADMIN_TENANT_NAME%/admin/g" -i ${SWIFT_CONF_DIR}/test.conf |
| 95 | sed "s/%ADMIN_USER%/admin/g" -i ${SWIFT_CONF_DIR}/test.conf | 95 | sed "s/%ADMIN_USER%/admin/g" -i ${SWIFT_CONF_DIR}/test.conf |
| 96 | sed "s/%ADMIN_PASSWORD%/${ADMIN_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/test.conf | 96 | sed "s/%ADMIN_PASSWORD%/${ADMIN_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/test.conf |
| 97 | sed "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" -i ${SWIFT_CONF_DIR}/test.conf | 97 | sed "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" -i ${SWIFT_CONF_DIR}/test.conf |
| 98 | sed "s/%SERVICE_USER%/${SRCNAME}/g" -i ${SWIFT_CONF_DIR}/test.conf | 98 | sed "s/%SERVICE_USER%/${SRCNAME}/g" -i ${SWIFT_CONF_DIR}/test.conf |
| 99 | sed "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/test.conf | 99 | sed "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/test.conf |
| 100 | sed "s/%DEMO_USER%/demo/g" -i ${SWIFT_CONF_DIR}/test.conf | 100 | sed "s/%DEMO_USER%/demo/g" -i ${SWIFT_CONF_DIR}/test.conf |
| 101 | sed "s/%DEMO_PASSWORD%/${ADMIN_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/test.conf | 101 | sed "s/%DEMO_PASSWORD%/${ADMIN_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/test.conf |
| 102 | 102 | ||
| 103 | sed "s/%SWIFT_BACKING_FILE_SIZE%/${SWIFT_BACKING_FILE_SIZE}/g" -i ${D}${sysconfdir}/init.d/swift | 103 | sed "s/%SWIFT_BACKING_FILE_SIZE%/${SWIFT_BACKING_FILE_SIZE}/g" -i ${D}${sysconfdir}/init.d/swift |
| 104 | sed "s/%CONTROLLER_IP%/${CONTROLLER_IP}/g" -i ${D}${sysconfdir}/init.d/swift | 104 | sed "s/%CONTROLLER_IP%/${CONTROLLER_IP}/g" -i ${D}${sysconfdir}/init.d/swift |
| 105 | fi | 105 | |
| 106 | cp -r test ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/ | 106 | cp -r test ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/ |
| 107 | grep -rl '^from test' ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/test | xargs sed 's/^from test/from swift\.test/g' -i | 107 | grep -rl '^from test' ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/test | xargs sed 's/^from test/from swift\.test/g' -i |
| 108 | 108 | ||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | CHEF_SERVICES_CONF_FILES := " \ | ||
| 112 | ${sysconfdir}/${SRCNAME}/test.conf \ | ||
| 113 | ${sysconfdir}/${SRCNAME}/dispersion.conf \ | ||
| 114 | ${sysconfdir}/${SRCNAME}/proxy-server.conf \ | ||
| 115 | ${sysconfdir}/init.d/swift \ | ||
| 116 | " | ||
| 117 | |||
| 118 | pkg_postinst_${SRCNAME}-setup () { | 111 | pkg_postinst_${SRCNAME}-setup () { |
| 119 | if [ "x$D" != "x" ]; then | 112 | if [ "x$D" != "x" ]; then |
| 120 | exit 1 | 113 | exit 1 |
diff --git a/meta-openstack/recipes-extended/cloud-init/cloud-init_0.7.6.bb b/meta-openstack/recipes-extended/cloud-init/cloud-init_0.7.6.bb index 01ee924..c6b3529 100644 --- a/meta-openstack/recipes-extended/cloud-init/cloud-init_0.7.6.bb +++ b/meta-openstack/recipes-extended/cloud-init/cloud-init_0.7.6.bb | |||
| @@ -28,19 +28,15 @@ do_install_prepend() { | |||
| 28 | 28 | ||
| 29 | do_install_append() { | 29 | do_install_append() { |
| 30 | install -m 0755 ${WORKDIR}/cloud.cfg ${D}${sysconfdir}/cloud/cloud.cfg | 30 | install -m 0755 ${WORKDIR}/cloud.cfg ${D}${sysconfdir}/cloud/cloud.cfg |
| 31 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | 31 | |
| 32 | sed -e "s:%MANAGE_HOSTS%:${MANAGE_HOSTS}:g" -i ${D}${sysconfdir}/cloud/cloud.cfg | 32 | sed -e "s:%MANAGE_HOSTS%:${MANAGE_HOSTS}:g" -i ${D}${sysconfdir}/cloud/cloud.cfg |
| 33 | sed -e "s:%HOSTNAME%:${HOSTNAME}:g" -i ${D}${sysconfdir}/cloud/cloud.cfg | 33 | sed -e "s:%HOSTNAME%:${HOSTNAME}:g" -i ${D}${sysconfdir}/cloud/cloud.cfg |
| 34 | fi | 34 | |
| 35 | ln -s ${libdir}/${BPN}/uncloud-init ${D}${sysconfdir}/cloud/uncloud-init | 35 | ln -s ${libdir}/${BPN}/uncloud-init ${D}${sysconfdir}/cloud/uncloud-init |
| 36 | ln -s ${libdir}/${BPN}/write-ssh-key-fingerprints ${D}${sysconfdir}/cloud/write-ssh-key-fingerprints | 36 | ln -s ${libdir}/${BPN}/write-ssh-key-fingerprints ${D}${sysconfdir}/cloud/write-ssh-key-fingerprints |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | inherit setuptools update-rc.d openstackchef | 39 | inherit setuptools update-rc.d |
| 40 | |||
| 41 | CHEF_SERVICES_CONF_FILES := " \ | ||
| 42 | ${sysconfdir}/cloud/cloud.cfg \ | ||
| 43 | " | ||
| 44 | 40 | ||
| 45 | PACKAGES += "${PN}-systemd" | 41 | PACKAGES += "${PN}-systemd" |
| 46 | 42 | ||
diff --git a/meta-openstack/recipes-extended/glusterfs/glusterfs_3.4.2.bbappend b/meta-openstack/recipes-extended/glusterfs/glusterfs_3.4.2.bbappend deleted file mode 100644 index b52d27a..0000000 --- a/meta-openstack/recipes-extended/glusterfs/glusterfs_3.4.2.bbappend +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Copyright (C) 2013 Wind River Systems, Inc. | ||
| 3 | # | ||
| 4 | inherit openstackchef | ||
| 5 | |||
| 6 | |||
diff --git a/meta-openstack/recipes-extended/rabbitmq/rabbitmq-server_3.2.4.bb b/meta-openstack/recipes-extended/rabbitmq/rabbitmq-server_3.2.4.bb index 6ac3e59..101d098 100644 --- a/meta-openstack/recipes-extended/rabbitmq/rabbitmq-server_3.2.4.bb +++ b/meta-openstack/recipes-extended/rabbitmq/rabbitmq-server_3.2.4.bb | |||
| @@ -46,7 +46,7 @@ do_install() { | |||
| 46 | mv ${D}/plugins ${RABBIT_LIB_DIR}/plugins | 46 | mv ${D}/plugins ${RABBIT_LIB_DIR}/plugins |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | inherit useradd update-rc.d openstackchef | 49 | inherit useradd update-rc.d |
| 50 | 50 | ||
| 51 | USERADD_PACKAGES = "${PN}" | 51 | USERADD_PACKAGES = "${PN}" |
| 52 | GROUPADD_PARAM_${PN} = "--system rabbitmq" | 52 | GROUPADD_PARAM_${PN} = "--system rabbitmq" |
diff --git a/meta-openstack/recipes-support/deploychef/deploychef_0.1.bb b/meta-openstack/recipes-support/deploychef/deploychef_0.1.bb deleted file mode 100644 index 6237538..0000000 --- a/meta-openstack/recipes-support/deploychef/deploychef_0.1.bb +++ /dev/null | |||
| @@ -1,100 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Copyright (C) 2014 Wind River Systems, Inc. | ||
| 3 | # | ||
| 4 | SUMMARY = "For the provisioning of OpenStack nodes" | ||
| 5 | DESCRIPTION = "There are a number of variables that are baked into Openstack \ | ||
| 6 | at build time, for example the ip address of a compute or controller node. \ | ||
| 7 | This means that when a new compute or controller node boots up, it will \ | ||
| 8 | have an ip address that differs from its currently assigned ip address \ | ||
| 9 | This package facilitates the recreation of openstack script and \ | ||
| 10 | configuration files, as well as their placement in the appropriate directories on \ | ||
| 11 | the files system on a compute/controller/allinone node at runtime" | ||
| 12 | |||
| 13 | LICENSE = "MIT" | ||
| 14 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ | ||
| 15 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
| 16 | |||
| 17 | PR = "r1" | ||
| 18 | |||
| 19 | |||
| 20 | RDEPENDS_${PN} = "chef" | ||
| 21 | SRC_URI = "\ | ||
| 22 | file://deploychef.init \ | ||
| 23 | file://attributes.json \ | ||
| 24 | file://config.rb \ | ||
| 25 | file://default_recipe.rb \ | ||
| 26 | file://run-openstackchef \ | ||
| 27 | file://run-postinsts \ | ||
| 28 | file://run-deploychef \ | ||
| 29 | file://service-shutdown \ | ||
| 30 | file://deploychef-inc \ | ||
| 31 | " | ||
| 32 | inherit update-rc.d identity hosts default_configs | ||
| 33 | |||
| 34 | S = "${WORKDIR}" | ||
| 35 | #Since this package does not need to be ran for each boot-up | ||
| 36 | #There is no need for an init scrpt so install it in /opt/${BPN} | ||
| 37 | DEPLOYCHEF_ROOT_DIR ?= "/opt/${BPN}" | ||
| 38 | POSTINSTS_DIR ?= "rpm-postinsts" | ||
| 39 | |||
| 40 | #Provide a mechanism for these strings to be over-written if necessary | ||
| 41 | COOKBOOK_DIR = "${DEPLOYCHEF_ROOT_DIR}/cookbooks/" | ||
| 42 | ATTRIBUTE_DIR = "${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/attributes/" | ||
| 43 | RECIPE_DIR = "${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/recipes/" | ||
| 44 | |||
| 45 | FILES_${PN} += " \ | ||
| 46 | ${DEPLOYCHEF_ROOT_DIR}/* \ | ||
| 47 | ${DEPLOYCHEF_ROOT_DIR}/conf-templates/* \ | ||
| 48 | ${DEPLOYCHEF_ROOT_DIR}/cookbooks/* \ | ||
| 49 | ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/recipes/* \ | ||
| 50 | ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/templates/* \ | ||
| 51 | ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/templates/default \ | ||
| 52 | ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/attributes \ | ||
| 53 | ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/attributes/* \ | ||
| 54 | " | ||
| 55 | #Read the module config files and make them into | ||
| 56 | #chef-solo templates | ||
| 57 | do_install() { | ||
| 58 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 59 | #This script will make templates out of postinst script before they | ||
| 60 | #have a chance to run | ||
| 61 | install -d ${D}${sysconfdir}/init.d | ||
| 62 | install -m 0755 ${S}/${BPN}.init ${D}${sysconfdir}/init.d/${BPN} | ||
| 63 | |||
| 64 | install -d ${D}/${DEPLOYCHEF_ROOT_DIR} | ||
| 65 | #Copy the template configuration scripts to image directory | ||
| 66 | install -m 0644 ${S}/config.rb ${D}/${DEPLOYCHEF_ROOT_DIR}/config.rb | ||
| 67 | install -m 0644 ${S}/attributes.json ${D}/${DEPLOYCHEF_ROOT_DIR}/attributes.json | ||
| 68 | install -m 0755 ${S}/run-postinsts ${D}/${DEPLOYCHEF_ROOT_DIR}/run-postinsts | ||
| 69 | install -m 0755 ${S}/run-openstackchef ${D}/${DEPLOYCHEF_ROOT_DIR}/run-openstackchef | ||
| 70 | install -m 0755 ${S}/run-deploychef ${D}/${DEPLOYCHEF_ROOT_DIR}/run-deploychef | ||
| 71 | install -m 0755 ${S}/service-shutdown ${D}/${DEPLOYCHEF_ROOT_DIR}/service-shutdown | ||
| 72 | install -m 0644 ${S}/deploychef-inc ${D}/${DEPLOYCHEF_ROOT_DIR}/deploychef-inc | ||
| 73 | #Copy the chefsolo recipe file to chefsolo recipe folder | ||
| 74 | install -d ${D}/${RECIPE_DIR} | ||
| 75 | install -m 0644 ${S}/default_recipe.rb ${D}/${RECIPE_DIR}/default.rb | ||
| 76 | fi | ||
| 77 | } | ||
| 78 | |||
| 79 | do_install_append() { | ||
| 80 | |||
| 81 | #Replace all required placeholders | ||
| 82 | for file in "${D}/${DEPLOYCHEF_ROOT_DIR}/run-deploychef \ | ||
| 83 | ${D}/${DEPLOYCHEF_ROOT_DIR}/service-shutdown \ | ||
| 84 | ${D}/${DEPLOYCHEF_ROOT_DIR}/deploychef-inc \ | ||
| 85 | ${D}/${DEPLOYCHEF_ROOT_DIR}/run-postinsts \ | ||
| 86 | ${D}/${DEPLOYCHEF_ROOT_DIR}/run-openstackchef \ | ||
| 87 | ${D}/${RECIPE_DIR}/default.rb \ | ||
| 88 | ${D}/${sysconfdir}/init.d/${BPN} "; do | ||
| 89 | |||
| 90 | sed -i s:%SYSCONFDIR%:${sysconfdir}:g $file | ||
| 91 | sed -i s:%POSTINSTS_DIR%:${POSTINSTS_DIR}:g $file | ||
| 92 | sed -i s:%PACKAGE_NAME%:${BPN}:g $file | ||
| 93 | sed -i s:%DEPLOYCHEF_ROOT_DIR%:${DEPLOYCHEF_ROOT_DIR}:g $file | ||
| 94 | done | ||
| 95 | } | ||
| 96 | |||
| 97 | INITSCRIPT_PACKAGES = "${BPN}" | ||
| 98 | INITSCRIPT_NAME_${BPN} = "${BPN}" | ||
| 99 | INITSCRIPT_PARAMS = "start 96 S ." | ||
| 100 | |||
diff --git a/meta-openstack/recipes-support/deploychef/files/deploychef.init b/meta-openstack/recipes-support/deploychef/files/deploychef.init deleted file mode 100644 index 22f318b..0000000 --- a/meta-openstack/recipes-support/deploychef/files/deploychef.init +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | #After this script executes, it runs the 'run-openstackchef' script found in | ||
| 3 | #/opt/deploychef/ directory. After that, all the | ||
| 4 | #configuration files that were registered with openstackchef class are | ||
| 5 | #created using run-time environment variables and default values | ||
| 6 | # found in /opt/deploychef/cookbooks/openstack/attributes/default.rb | ||
| 7 | deploychef_root=%DEPLOYCHEF_ROOT_DIR% | ||
| 8 | LOG_DIR=/var/log/%PACKAGE_NAME% | ||
| 9 | LOG_FILE=$LOG_DIR/%PACKAGE_NAME%.log | ||
| 10 | script_file=$deploychef_root/run-openstackchef | ||
| 11 | chefsolo_success_file="%SYSCONFDIR%/chefsolo.ran" | ||
| 12 | if [ ! -f $chefsolo_success_file ]; then | ||
| 13 | if [ -f $script_file ] ; then | ||
| 14 | mkdir -p $LOG_DIR | ||
| 15 | #Remove deploy init script if present | ||
| 16 | rm -f /etc/init.d/deploy 2>/dev/null | ||
| 17 | cd $deploychef_root | ||
| 18 | . $(basename $script_file) | ||
| 19 | if [ $? = 0 ]; then | ||
| 20 | echo "Deploychef successfully created chefsolo configuration files" \ | ||
| 21 | > $LOG_FILE | ||
| 22 | else | ||
| 23 | echo "deploychef ERROR: $i failed." > $LOG_FILE | ||
| 24 | fi | ||
| 25 | fi | ||
| 26 | fi | ||
diff --git a/meta-openstack/recipes-support/deploychef/files/run-deploychef b/meta-openstack/recipes-support/deploychef/files/run-deploychef deleted file mode 100644 index 4fd41d8..0000000 --- a/meta-openstack/recipes-support/deploychef/files/run-deploychef +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # run-deploychef | ||
| 3 | # | ||
| 4 | # Copyright (c) 2014 Wind River Systems, Inc. | ||
| 5 | # | ||
| 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 7 | # of this software and associated documentation files (the "Software"), to deal | ||
| 8 | # in the Software without restriction, including without limitation the rights | ||
| 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 10 | # copies of the Software, and to permit persons to whom the Software is | ||
| 11 | # furnished to do so, subject to the following conditions: | ||
| 12 | # | ||
| 13 | # The above copyright notice and this permission notice shall be included in | ||
| 14 | # all copies or substantial portions of the Software. | ||
| 15 | |||
| 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 22 | # THE SOFTWARE. | ||
| 23 | # | ||
| 24 | # | ||
| 25 | # This file is the main script file that reconfigures the stack when any of | ||
| 26 | # the attributes variables change at run-time. | ||
| 27 | # | ||
| 28 | #Shutdown all registered services | ||
| 29 | . ./service-shutdown | ||
| 30 | #Re-generate configuration files from template files | ||
| 31 | . ./run-openstackchef | ||
| 32 | #Run post-install script and then start services | ||
| 33 | . ./run-postinsts | ||
diff --git a/meta-openstack/recipes-support/deploychef/files/run-openstackchef b/meta-openstack/recipes-support/deploychef/files/run-openstackchef deleted file mode 100644 index 18e6a68..0000000 --- a/meta-openstack/recipes-support/deploychef/files/run-openstackchef +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # run-openstackchef | ||
| 3 | # | ||
| 4 | # Copyright (c) 2014 Wind River Systems, Inc. | ||
| 5 | # | ||
| 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 7 | # of this software and associated documentation files (the "Software"), to deal | ||
| 8 | # in the Software without restriction, including without limitation the rights | ||
| 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 10 | # copies of the Software, and to permit persons to whom the Software is | ||
| 11 | # furnished to do so, subject to the following conditions: | ||
| 12 | # | ||
| 13 | # The above copyright notice and this permission notice shall be included in | ||
| 14 | # all copies or substantial portions of the Software. | ||
| 15 | |||
| 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 22 | # THE SOFTWARE. | ||
| 23 | # | ||
| 24 | # | ||
| 25 | # This script just runs chefsolo to generate our configuration files | ||
| 26 | # | ||
| 27 | # | ||
| 28 | #Use chefsolo to generate configuration files/scripts base on | ||
| 29 | #templates if templates/default | ||
| 30 | chef-solo -f -c config.rb -j attributes.json | ||
diff --git a/meta-openstack/recipes-support/postgresql/postgresql_9.%.bbappend b/meta-openstack/recipes-support/postgresql/postgresql_9.%.bbappend index 42ceaf8..22dae71 100644 --- a/meta-openstack/recipes-support/postgresql/postgresql_9.%.bbappend +++ b/meta-openstack/recipes-support/postgresql/postgresql_9.%.bbappend | |||
| @@ -3,7 +3,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | |||
| 3 | SRC_URI += "file://postgresql \ | 3 | SRC_URI += "file://postgresql \ |
| 4 | file://postgresql-init" | 4 | file://postgresql-init" |
| 5 | 5 | ||
| 6 | inherit useradd update-rc.d identity hosts openstackchef | 6 | inherit useradd update-rc.d identity hosts |
| 7 | 7 | ||
| 8 | PACKAGECONFIG[libxml] = "--with-libxml CFLAGS=-I${STAGING_INCDIR}/libxml2,--without-libxml,libxml2,libxml2" | 8 | PACKAGECONFIG[libxml] = "--with-libxml CFLAGS=-I${STAGING_INCDIR}/libxml2,--without-libxml,libxml2,libxml2" |
| 9 | 9 | ||
| @@ -16,25 +16,19 @@ do_install_append() { | |||
| 16 | install -d ${D}${sysconfdir}/init.d/ | 16 | install -d ${D}${sysconfdir}/init.d/ |
| 17 | install -m 0755 ${WORKDIR}/postgresql ${INIT_D_DEST_DIR}/postgresql | 17 | install -m 0755 ${WORKDIR}/postgresql ${INIT_D_DEST_DIR}/postgresql |
| 18 | install -m 0755 ${WORKDIR}/postgresql-init ${INIT_D_DEST_DIR}/postgresql-init | 18 | install -m 0755 ${WORKDIR}/postgresql-init ${INIT_D_DEST_DIR}/postgresql-init |
| 19 | if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then | ||
| 20 | sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql | ||
| 21 | sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql-init | ||
| 22 | 19 | ||
| 23 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${INIT_D_DEST_DIR}/postgresql-init | 20 | sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql |
| 24 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${INIT_D_DEST_DIR}/postgresql-init | 21 | sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql-init |
| 25 | 22 | ||
| 26 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init | 23 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${INIT_D_DEST_DIR}/postgresql-init |
| 27 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init | 24 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${INIT_D_DEST_DIR}/postgresql-init |
| 28 | 25 | ||
| 29 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init | 26 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init |
| 30 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init | 27 | sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init |
| 31 | fi | ||
| 32 | } | ||
| 33 | 28 | ||
| 34 | CHEF_SERVICES_CONF_FILES := "\ | 29 | sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init |
| 35 | ${sysconfdir}/init.d/postgresql \ | 30 | sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init |
| 36 | ${sysconfdir}/init.d/postgresql-init \ | 31 | } |
| 37 | " | ||
| 38 | 32 | ||
| 39 | RDEPENDS_${PN} += "postgresql-timezone eglibc-utils update-rc.d" | 33 | RDEPENDS_${PN} += "postgresql-timezone eglibc-utils update-rc.d" |
| 40 | USERADD_PACKAGES = "${PN}" | 34 | USERADD_PACKAGES = "${PN}" |
