summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-support/deploychef/deploychef_0.1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-support/deploychef/deploychef_0.1.bb')
-rw-r--r--meta-openstack/recipes-support/deploychef/deploychef_0.1.bb100
1 files changed, 0 insertions, 100 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#
4SUMMARY = "For the provisioning of OpenStack nodes"
5DESCRIPTION = "There are a number of variables that are baked into Openstack \
6at build time, for example the ip address of a compute or controller node. \
7This means that when a new compute or controller node boots up, it will \
8have an ip address that differs from its currently assigned ip address \
9This package facilitates the recreation of openstack script and \
10configuration files, as well as their placement in the appropriate directories on \
11the files system on a compute/controller/allinone node at runtime"
12
13LICENSE = "MIT"
14LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
15 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
16
17PR = "r1"
18
19
20RDEPENDS_${PN} = "chef"
21SRC_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 "
32inherit update-rc.d identity hosts default_configs
33
34S = "${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}
37DEPLOYCHEF_ROOT_DIR ?= "/opt/${BPN}"
38POSTINSTS_DIR ?= "rpm-postinsts"
39
40#Provide a mechanism for these strings to be over-written if necessary
41COOKBOOK_DIR = "${DEPLOYCHEF_ROOT_DIR}/cookbooks/"
42ATTRIBUTE_DIR = "${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/attributes/"
43RECIPE_DIR = "${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/recipes/"
44
45FILES_${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
57do_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
79do_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
97INITSCRIPT_PACKAGES = "${BPN}"
98INITSCRIPT_NAME_${BPN} = "${BPN}"
99INITSCRIPT_PARAMS = "start 96 S ."
100