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/recipes-support | |
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/recipes-support')
5 files changed, 10 insertions, 205 deletions
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}" |