1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
DESCRIPTION = "OpenStack Orchestration"
HOMEPAGE = "https://launchpad.net/heat"
SECTION = "devel/python"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"
PR = "r0"
SRCNAME = "heat"
SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=master \
file://heat.conf \
file://heat.init \
file://autoscaling_example.template \
file://one_vm_example.template \
file://two_vms_example.template \
file://heat-tests-change-project_dir-path.patch \
"
SRCREV="9b700a1b6e1c806d8deba64ffb9a804790765678"
PV="2014.2.b3+git${SRCPV}"
S = "${WORKDIR}/git"
SERVICECREATE_PACKAGES = "${SRCNAME}-setup ${SRCNAME}-templates ${SRCNAME}-cfn"
KEYSTONE_HOST="${CONTROLLER_IP}"
# USERCREATE_PARAM and SERVICECREATE_PARAM contain the list of parameters to be set.
# If the flag for a parameter in the list is not set here, the default value will be given to that parameter.
# Parameters not in the list will be set to empty.
USERCREATE_PARAM_${SRCNAME}-setup = "name pass tenant role email"
SERVICECREATE_PARAM_${SRCNAME}-setup = "name type description region publicurl adminurl internalurl"
python () {
flags = {'type':'orchestration',\
'description':'OpenStack Orchestration Service',\
'publicurl':"'http://${KEYSTONE_HOST}:8004/v1/\$(tenant_id)s'",\
'adminurl':"'http://${KEYSTONE_HOST}:8004/v1/\$(tenant_id)s'",\
'internalurl':"'http://${KEYSTONE_HOST}:8004/v1/\$(tenant_id)s'"}
d.setVarFlags("SERVICECREATE_PARAM_%s-setup" % d.getVar('SRCNAME',True), flags)
}
# heat stack template user role
USERCREATE_PARAM_${SRCNAME}-templates = "role"
python () {
flags = {'role':'heat_stack_user'}
d.setVarFlags("USERCREATE_PARAM_%s-templates" % d.getVar('SRCNAME',True), flags)
}
# api-cfn service
SERVICECREATE_PARAM_${SRCNAME}-cfn = "name type description region publicurl adminurl internalurl"
python () {
flags = {'name':'heat-cfn',\
'type':'cloudformation',\
'description':'OpenStack Cloudformation Service',\
'publicurl':"'http://${KEYSTONE_HOST}:8000/v1'",\
'adminurl':"'http://${KEYSTONE_HOST}:8000/v1'",\
'internalurl':"'http://${KEYSTONE_HOST}:8000/v1'"}
d.setVarFlags("SERVICECREATE_PARAM_%s-cfn" % d.getVar('SRCNAME',True), flags)
}
do_install_append() {
TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME}
HEAT_CONF_DIR=${D}${sysconfdir}/${SRCNAME}
install -d ${HEAT_CONF_DIR}
install -m 600 ${WORKDIR}/heat.conf ${HEAT_CONF_DIR}
install -m 600 ${TEMPLATE_CONF_DIR}/*.json ${HEAT_CONF_DIR}
install -d ${HEAT_CONF_DIR}/templates
install -m 600 ${TEMPLATE_CONF_DIR}/templates/* ${HEAT_CONF_DIR}/templates
install -m 600 ${WORKDIR}/*.template ${HEAT_CONF_DIR}/templates
install -d ${HEAT_CONF_DIR}/environment.d
install -m 600 ${TEMPLATE_CONF_DIR}/environment.d/* ${HEAT_CONF_DIR}/environment.d
install -m 664 ${TEMPLATE_CONF_DIR}/api-paste.ini ${HEAT_CONF_DIR}
if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then
sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
-i ${HEAT_CONF_DIR}/api-paste.ini
sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${HEAT_CONF_DIR}/api-paste.ini
sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" -i ${HEAT_CONF_DIR}/api-paste.ini
sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/api-paste.ini
sed -e "s:%DB_USER%:${DB_USER}:g" -i ${HEAT_CONF_DIR}/heat.conf
sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf
sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf
sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf
sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${HEAT_CONF_DIR}/heat.conf
sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${HEAT_CONF_DIR}/heat.conf
sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${HEAT_CONF_DIR}/heat.conf
sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${HEAT_CONF_DIR}/heat.conf
fi
if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/init.d
sed 's:@suffix@:api:' < ${WORKDIR}/heat.init >${WORKDIR}/heat-api.init.sh
install -m 0755 ${WORKDIR}/heat-api.init.sh ${D}${sysconfdir}/init.d/heat-api
sed 's:@suffix@:api-cfn:' < ${WORKDIR}/heat.init >${WORKDIR}/heat-api-cfn.init.sh
install -m 0755 ${WORKDIR}/heat-api-cfn.init.sh ${D}${sysconfdir}/init.d/heat-api-cfn
sed 's:@suffix@:engine:' < ${WORKDIR}/heat.init >${WORKDIR}/heat-engine.init.sh
install -m 0755 ${WORKDIR}/heat-engine.init.sh ${D}${sysconfdir}/init.d/heat-engine
fi
cp run_tests.sh ${HEAT_CONF_DIR}
}
CHEF_SERVICES_CONF_FILES :="\
${sysconfdir}/${SRCNAME}/heat.conf \
${sysconfdir}/${SRCNAME}/api-paste.ini \
"
pkg_postinst_${SRCNAME}-setup () {
if [ "x$D" != "x" ]; then
exit 1
fi
# This is to make sure postgres is configured and running
if ! pidof postmaster > /dev/null; then
/etc/init.d/postgresql-init
/etc/init.d/postgresql start
sleep 2
fi
mkdir /var/log/heat
sudo -u postgres createdb heat
heat-manage db_sync
}
inherit setuptools identity hosts update-rc.d default_configs openstackchef
PACKAGES += "${SRCNAME}-tests ${SRCNAME}-templates ${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine"
PACKAGES += "${SRCNAME}-setup"
PACKAGES += "${SRCNAME}-cfn"
ALLOW_EMPTY_${SRCNAME}-setup = "1"
ALLOW_EMPTY_${SRCNAME}-templates = "1"
ALLOW_EMPTY_${SRCNAME}-cfn = "1"
FILES_${PN} = "${libdir}/*"
FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh"
FILES_${SRCNAME}-templates = "${sysconfdir}/${SRCNAME}/templates/*"
FILES_${SRCNAME}-common = "${sysconfdir}/${SRCNAME}/* \
"
FILES_${SRCNAME}-api = "${bindir}/heat-api \
${sysconfdir}/init.d/heat-api \
"
FILES_${SRCNAME}-api-cfn = "${bindir}/heat-api-cfn \
${sysconfdir}/init.d/heat-api-cfn \
"
FILES_${SRCNAME}-engine = "${bindir}/heat-engine \
${bindir}/* \
${sysconfdir}/init.d/heat-engine \
"
DEPENDS += " \
python-pip \
python-pbr \
"
RDEPENDS_${PN} += " \
python-heatclient \
python-sqlalchemy \
python-amqplib \
python-anyjson \
python-eventlet \
python-kombu \
python-lxml \
python-routes \
python-webob \
python-greenlet \
python-lockfile \
python-pastedeploy \
python-paste \
python-sqlalchemy-migrate \
python-stevedore \
python-suds \
python-paramiko \
python-babel \
python-iso8601 \
python-setuptools-git \
python-glanceclient \
python-keystoneclient \
python-swiftclient \
python-oslo.config \
python-msgpack \
python-pecan \
python-amqp \
python-singledispatch \
python-flask \
python-werkzeug \
python-itsdangerous \
python-happybase \
python-wsme \
python-eventlet \
python-pymongo \
python-thrift \
python-simplegeneric \
python-webtest \
python-waitress \
python-pyyaml \
python-pip \
python-pytz \
python-pbr \
"
RDEPENDS_${SRCNAME}-engine = "${PN} ${SRCNAME}-templates ${SRCNAME}-common postgresql postgresql-client python-psycopg2 tgt ${SRCNAME}-cfn"
RDEPENDS_${SRCNAME}-api = "${SRCNAME}-engine"
RDEPENDS_${SRCNAME}-api-cfn = "${SRCNAME}-engine"
RDEPENDS_${SRCNAME}-setup = "postgresql sudo ${SRCNAME}-engine"
RDEPENDS_${SRCNAME}-templates = "postgresql sudo"
RDEPENDS_${SRCNAME}-cfn = "postgresql sudo"
INITSCRIPT_PACKAGES = "${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine"
INITSCRIPT_NAME_${SRCNAME}-api = "${SRCNAME}-api"
INITSCRIPT_PARAMS_${SRCNAME}-api = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
INITSCRIPT_NAME_${SRCNAME}-api-cfn = "${SRCNAME}-api-cfn"
INITSCRIPT_PARAMS_${SRCNAME}-api-cfn = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
INITSCRIPT_NAME_${SRCNAME}-engine = "${SRCNAME}-engine"
INITSCRIPT_PARAMS_${SRCNAME}-engine = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
|