summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-support
diff options
context:
space:
mode:
authorMustapha Lansana <Mustapha.Lansana@windriver.com>2014-07-30 20:21:11 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-09-26 09:09:21 -0400
commitef4a3055abee950950c2aac127854eb9e83f2793 (patch)
tree47912200c661dc5884ffc1bddd86004eb64c89c3 /meta-openstack/recipes-support
parent1675bd0d6c8b7cb69e044a9d75b6ad1d43ce3ccb (diff)
downloadmeta-cloud-services-ef4a3055abee950950c2aac127854eb9e83f2793.tar.gz
deploychef: result of adapting deploychef to openstackchef class
The functionality the following files provide are now implemented in openstackchef class, they are no longer needed in the deploychef package. Signed-off-by: Mustapha Lansana <Mustapha.Lansana@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-support')
-rw-r--r--meta-openstack/recipes-support/deploychef/files/chefsolo_default_attribute.rb76
-rw-r--r--meta-openstack/recipes-support/deploychef/files/chefsolo_default_recipe.rb264
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/ceilometer-template.inc19
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/ceph-template.inc26
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/cinder-template.inc21
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/constants.inc23
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/glance-template.inc16
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/heat-template.inc15
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/hosts-template.inc10
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/keystone-template.inc24
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/neutron-template.inc24
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/nova-template.inc47
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/postgresql-template.inc12
-rw-r--r--meta-openstack/recipes-support/deploychef/files/conf-templates/swift-template.inc37
-rw-r--r--meta-openstack/recipes-support/deploychef/files/generate-templates274
15 files changed, 0 insertions, 888 deletions
diff --git a/meta-openstack/recipes-support/deploychef/files/chefsolo_default_attribute.rb b/meta-openstack/recipes-support/deploychef/files/chefsolo_default_attribute.rb
deleted file mode 100644
index caf5af2..0000000
--- a/meta-openstack/recipes-support/deploychef/files/chefsolo_default_attribute.rb
+++ /dev/null
@@ -1,76 +0,0 @@
1#
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 deal
6# in the Software without restriction, including without limitation the rights
7# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8# copies of the Software, and to permit persons to whom the Software is
9# furnished to do so, subject to the following conditions:
10#
11# The above copyright notice and this permission notice shall be included in
12# all copies or substantial portions of the Software.
13#
14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20# THE SOFTWARE.
21#
22#
23#These are the default values that chef-solo uses
24#to convert our template files into the respective
25#configuration and script files we want it to bake.
26#Note though that Some of which are overwritten in the recipe file(s)
27
28default["CHEFROOT_DIR"] ="%DEPLOYCHEF_ROOT_DIR%/"
29default["TEMPLATE_DIR"] ="#{node[:CHEFROOT_DIR]}cookbooks/openstack/templates/default/*"
30default["ETC_DIR"]= "%SYSCONFDIR%/"
31default["POSTINSTS_DIR"] ="#{node[:ETC_DIR]}%POSTINSTS_DIR%/"
32default["NOVA_CONF_DIR"]="#{node[:ETC_DIR]}nova/"
33default["SWIFT_CONF_DIR"]="#{node[:ETC_DIR]}swift/"
34default["CEILOMETER_CONF_DIR"]="#{node[:ETC_DIR]}ceilometer/"
35default["NEUTRON_CONF_DIR"]= "#{node[:ETC_DIR]}neutron/"
36default["NEUTRON_CORE_PLUGIN"]= "neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2"
37default["OPENVSWITCH_CONF_DIR"]= "#{node[:NEUTRON_CONF_DIR]}plugins/openvswitch/"
38default["LINUXBRIDGE_CONF_DIR"]= "#{node[:NEUTRON_CONF_DIR]}plugins/linuxbridge/"
39default["KEYSTONE_CONF_DIR"]= "#{node[:ETC_DIR]}keystone/"
40default["CINDER_CONF_DIR"]= "#{node[:ETC_DIR]}cinder/"
41default["GLANCE_CONF_DIR"]= "#{node[:ETC_DIR]}glance/"
42default["CEPH_CONF_DIR"]= "#{node[:ETC_DIR]}ceph/"
43default["DB_DATADIR"]= "#{node[:ETC_DIR]}postgresql/"
44default["HEAT_CONF_DIR"]= "#{node[:ETC_DIR]}heat/"
45
46default["INITD_DIR"]= "#{node[:ETC_DIR]}init.d/"
47default["CONTROLLER_DAEMON"]= "#{node[:INITD_DIR]}nova-api"
48default["COMPUTE_DAEMON"]= "#{node[:INITD_DIR]}nova-compute"
49default["NODE_TYPE"]="compute"
50default["NODE_TYPES"]="compute controller allinone"
51default["POSTINSTS_SCRIPT"] = "run-postinsts"
52default["PREINSTS_SCRIPT"] = "service-shutdown"
53default["AUTH_PROTOCOL"] = "http"
54default["PRIVATE_IP"] = "127.0.0.1"
55
56default["CONTROLLER_IP"] = "%CONTROLLER_IP%"
57default["CONTROLLER_HOST"] = "%CONTROLLER_HOST%"
58default["COMPUTE_IP"] = "%COMPUTE_IP%"
59default["COMPUTE_HOST"] = "%COMPUTE_HOST%"
60default["ADMIN_PASSWORD"] = "%ADMIN_PASSWORD%"
61default["SERVICE_PASSWORD"] = "%SERVICE_PASSWORD%"
62default["SERVICE_TENANT_NAME"] ="%SERVICE_TENANT_NAME%"
63default["SERVICE_USER"] ="%SERVICE_USER%"
64default["SERVICE_TOKEN"] ="%SERVICE_TOKEN%"
65default["DEMO_USER"] ="%DEMO_USER%"
66default["DEMO_PASSWORD"] ="%DEMO_PASSWORD%"
67default["OS_TENANT_NAME"] ="%OS_TENANT_NAME%"
68default["OS_USERNAME"] ="%OS_USERNAME%"
69default["OS_PASSWORD"] ="%OS_PASSWORD%"
70default["DB_USER"] ="%DB_USER%"
71default["DB_PASSWORD"] ="%DB_PASSWORD%"
72default["PUBLIC_IP"] ="#{node[:CONTROLLER_IP]}"
73default["HOST_NAME"]="#{node[:CONTROLLER_HOSTS]}"
74default["PUBLIC_DOMAIN"] ="#{node[:CONTROLLER_IP]}/24"
75
76
diff --git a/meta-openstack/recipes-support/deploychef/files/chefsolo_default_recipe.rb b/meta-openstack/recipes-support/deploychef/files/chefsolo_default_recipe.rb
deleted file mode 100644
index 3c83b23..0000000
--- a/meta-openstack/recipes-support/deploychef/files/chefsolo_default_recipe.rb
+++ /dev/null
@@ -1,264 +0,0 @@
1# default.rb
2#
3# Copyright (c) 2014 Wind River Systems, Inc.
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to 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 FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21# THE SOFTWARE.
22#
23# This is our main recipe that chef-solo bakes to configure our openstack deployment
24domain = node['hostname']
25domain += " " + node['platform']
26domain += " " + node['platform_version']
27domain += " " + node['ipaddress']
28log domain do
29 level:info
30end
31
32#This function enables us to over-ride the hostname and ipaddress
33#attributes based on the type of node installation
34#we are running on.
35def update_node_info()
36 if File.executable?(node[:CONTROLLER_DAEMON]) and \
37 File.executable?(node[:COMPUTE_DAEMON])
38 #All in one installation
39 if node[:ipaddress].length
40 node.default["CONTROLLER_IP"]=node.default["COMPUTE_IP"]=node[:ipaddress]
41 end
42 if node[:hostname].length
43 node.default["CONTROLLER_HOST"]=node.default["COMPUTE_HOST"]=node[:hostname]
44 end
45 node.default["NODE_TYPE"] ="allinone"
46 elsif File.executable?(node[:CONTROLLER_DAEMON])
47 if node[:ipaddress].length
48 node.default["CONTROLLER_IP"]=node[:ipaddress]
49 end
50 if node[:hostname].length
51 node.default["CONTROLLER_HOST"]=node[:hostname]
52 end
53 node.default["NODE_TYPE"] ="controller"
54 else
55 if node[:ipaddress].length
56 node.default["COMPUTE_IP"]=node[:ipaddress]
57 end
58 if node[:hostname].length
59 node.default["COMPUTE_HOST"]=node[:hostname]
60 end
61 node.default["NODE_TYPE"] ="compute"
62 end
63
64 node.default["PUBLIC_IP"]="#{node[:CONTROLLER_IP]}"
65 node.default["HOST_NAME"]="#{node[:CONTROLLER_HOST]}"
66 node.default["PUBLIC_DOMAIN"]="#{node[:CONTROLLER_IP]}/24"
67end
68#This fucntion loops through all the files in the templates
69#directory and create configuration or scripts files from the
70#templates using the sets of defined attributes
71def create_files_from_templates()
72 #Make it easier to move from development environment to target
73 output_dir = node[:POSTINSTS_DIR]
74 template_dir = node[:TEMPLATE_DIR]
75 #See if output directory exist if not create one
76 if not File.directory?(output_dir)
77 execute "Create #{output_dir} directory" do
78 command "mkdir -p #{output_dir}"
79 end
80 end
81 #Get the list of all template files
82 files = Dir.glob(template_dir)
83 #To ensure that the files are executed in increasing order
84 files = files.sort
85 for file in files do
86 #Exclude references to current and parent directory in search
87 next if File.directory?(file) or file == '.' or file == '..'
88 script_file = output_dir + File.basename(file)
89 script_file.gsub!(".erb","")
90 if File.file?(script_file)
91 execute "Delete file #{script_file} if present" do
92 command "rm -rf #{script_file}"
93 end
94 end
95 template script_file do
96 source File.basename(file)
97 mode 0755
98 owner node[:user]
99 group node[:user]
100 end
101 end
102end
103#This function moves the generated configuration files for
104#the respective modules to the specified module configuration directory
105#Overwriting the current configuration file in the process
106def replace_config_files(files, configDir, makeNoneExec=true)
107 #!files.strip
108 #!configDir.strip
109 if files and configDir
110 if not File.directory?(configDir)
111 execute "Create #{configDir}" do
112 command "mkdir -p #{configDir}"
113 end
114 end
115 if files.strip.include?(" ")
116 file_names = files.split
117 file_names.each do | fileName |
118 fileName=fileName.strip
119 if File.file?("#{node[:POSTINSTS_DIR]}#{fileName}")
120 execute "Move #{fileName} to #{configDir} " do
121 command "mv #{node[:POSTINSTS_DIR]}#{fileName} #{configDir}#{fileName}"
122 end
123 if makeNoneExec
124 execute "Remove execution mode on #{fileName}" do
125 command "chmod 0644 #{configDir}#{fileName}"
126 end
127 end
128 end
129 end
130 else
131 #There is only one file in the list
132 files=files.strip
133 if File.file?("#{node[:POSTINSTS_DIR]}#{files}")
134 execute "Move #{files} to #{configDir} " do
135 command "mv #{node[:POSTINSTS_DIR]}#{files} #{configDir}#{files}"
136 end
137 if makeNoneExec
138 execute "Remove execution mode on #{files}" do
139 command "chmod 0644 #{configDir}#{files}"
140 end
141 end
142 end
143 end
144 end
145end
146
147#Update hostname and ipaddress to be written to configuration files
148update_node_info
149
150#Generate scripts and cofiguration files
151create_files_from_templates
152
153#Move the configuration files to /etc/nova directory
154#and make remove execution modifier from the files
155novaConfigFiles="nova.conf openrc api-paste.ini deploy.conf"
156replace_config_files(novaConfigFiles,"#{node[:NOVA_CONF_DIR]}")
157#Move the configuration files to /etc/swift directory
158#and remove execution modifier from the files
159swiftConfigFiles="test.conf dispersion.conf proxy-server.conf"
160if node[:NODE_TYPE] == "compute"
161 files = swiftConfigFiles.split
162 files.each do | fileName |
163 fileName=fileName.strip
164 fileName ="#{node[:POSTINSTS_DIR]}#{fileName}"
165 if File.file?(fileName)
166 execute "Remove file #{fileName}" do
167 command "rm #{node[:POSTINSTS_DIR]}#{fileName}"
168 end
169 end
170 end
171else
172 replace_config_files(swiftConfigFiles,"#{node[:SWIFT_CONF_DIR]}")
173end
174#Move the configuration files to /etc/neutron directory
175#and remove execution modifier from the files
176configFiles="neutron.conf"
177replace_config_files(configFiles,"#{node[:NEUTRON_CONF_DIR]}")
178configFiles="linuxbridge_conf.ini"
179replace_config_files(configFiles,"#{node[:LINUXBRIDGE_CONF_DIR]}")
180configFiles="ovs_neutron_plugin.ini"
181replace_config_files(configFiles,"#{node[:OPENVSWITCH_CONF_DIR]}")
182
183configFiles="ceilometer.conf"
184replace_config_files(configFiles,"#{node[:CEILOMETER_CONF_DIR]}")
185
186configFiles="glance-api.conf glance-cache.conf glance-registry.conf"
187if node[:NODE_TYPE] == "compute"
188 files = configFiles.split
189 files.each do | fileName |
190 if File.file?("#{node[:POSTINSTS_DIR]}#{fileName}")
191 execute "Remove file #{fileName}" do
192 command "rm #{node[:POSTINSTS_DIR]}#{fileName}"
193 end
194 end
195 end
196else
197 replace_config_files(configFiles,"#{node[:GLANCE_CONF_DIR]}")
198end
199
200#Move the postgresql init script and make them executable
201configFiles="postgresql-init"
202replace_config_files(configFiles, "#{node[:INITD_DIR]}", false)
203
204configFiles="ceph.conf"
205replace_config_files(configFiles, "#{node[:CEPH_CONF_DIR]}")
206
207configFiles="ceph-setup"
208if node[:NODE_TYPE] == "compute"
209 if File.file?("#{node[:POSTINSTS_DIR]}#{configFiles}")
210 execute "Remove file #{configFiles}" do
211 command "rm #{node[:POSTINSTS_DIR]}#{configFiles}"
212 end
213 end
214else
215 replace_config_files(configFiles, "#{node[:INITD_DIR]}", false)
216end
217
218configFiles="keystone.conf identity.sh"
219if node[:NODE_TYPE] == "compute"
220 files = configFiles.split
221 files.each do | fileName |
222 if File.file?("#{node[:POSTINSTS_DIR]}#{fileName}")
223 execute "Remove file #{fileName}" do
224 command "rm #{node[:POSTINSTS_DIR]}#{fileName}"
225 end
226 end
227 end
228else
229 replace_config_files(configFiles, "#{node[:KEYSTONE_CONF_DIR]}")
230 #Openrc in keystone conf dir is same as that found in nova
231 execute "Copy openrc to #{node[:KEYSTONE_CONF_DIR]}" do
232 command "cp #{node[:NOVA_CONF_DIR]}openrc #{node[:KEYSTONE_CONF_DIR]}"
233 end
234end
235#cinder configurations
236configFiles="api-paste.ini.cinder cinder.conf"
237replace_config_files(configFiles, "#{node[:CINDER_CONF_DIR]}")
238
239fileName="#{node[:CINDER_CONF_DIR]}api-paste.ini.cinder"
240if File.file?(fileName)
241 execute "Rename api-paste.ini.cinder to api-paste.ini" do
242 command "mv #{node[:CINDER_CONF_DIR]}api-paste.ini.cinder #{node[:CINDER_CONF_DIR]}api-paste.ini"
243 end
244end
245#heat configuration
246configFiles="heat.conf"
247if node[:NODE_TYPE] == "compute"
248 if File.file?("#{node[:POSTINSTS_DIR]}#{configFiles}")
249 execute "Remove file #{configFiles}" do
250 command "rm #{node[:POSTINSTS_DIR]}#{configFiles}"
251 end
252 end
253else
254 replace_config_files(configFiles, "#{node[:HEAT_CONF_DIR]}")
255end
256#Move the hosts file in place
257configFiles="hosts"
258replace_config_files(configFiles,"#{node[:ETC_DIR]}")
259
260=begin
261service host[:hostname] do
262 action :restart
263endf
264=end
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/ceilometer-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/ceilometer-template.inc
deleted file mode 100644
index 471ef1e..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/ceilometer-template.inc
+++ /dev/null
@@ -1,19 +0,0 @@
1#Ceilometer chefsolo template generation functions
2
3ceilometer-conf_chefsolo_template() {
4 file_name=$1
5 if [ -e $file_name ]; then
6 sed "s/^os_password=.*$/os_password=<%=node[:ADMIN_PASSWORD]%>/" -i $file_name
7 sed "s/^os_tenant_name=.*$/os_tenant_name= <%=node[:SERVICE_TENANT_NAME]%>/" -i $file_name
8 sed "s/^auth_host=.*$/auth_host=<%=node[:CONTROLLER_IP]%>/" -i $file_name
9 sed "s/^admin_password=.*$/admin_password= <%=node[:ADMIN_PASSWORD]%>/" -i $file_name
10 sed "s/^admin_tenant_name=.*$/admin_tenant_name= <%=node[:SERVICE_TENANT_NAME]%>/" -i $file_name
11
12 sed "s/^rabbit_host =.*$/rabbit_host = <%=node[:CONTROLLER_IP]%>/" -i $file_name
13 sed "s/$DB_USER:/<%=node[:DB_USER]%>:/g" -i $file_name
14 sed "s/$DB_PASSWORD@/<%=node[:DB_PASSWORD]%>@/g" -i $file_name
15 sed "s/$CONTROLLER_IP/<%=node[:CONTROLLER_IP]%>/g" -i $file_name
16 sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name
17 mv $file_name $file_name$SUFFIX
18 fi
19}
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/ceph-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/ceph-template.inc
deleted file mode 100644
index 2946808..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/ceph-template.inc
+++ /dev/null
@@ -1,26 +0,0 @@
1#!/bin/bash
2#Ceph related chefsolo template functions
3ceph-conf_chefsolo_template() {
4 file_name=$1
5 if [ -e $file_name ]; then
6 sed "s/mon initial members =.*$/mon initial members = <%=node[:HOST_NAME]%> /" -i $file_name
7 sed "s/mon host =.*$/mon host = <%=node[:PUBLIC_IP]%>/" -i $file_name
8
9 sed "s:public network =.*/:public network = <%=node[\:CONTROLLER_IP]%>/:" -i $file_name
10 sed "s/mon.$CONTROLLER_HOST/mon.<%=node[:HOST_NAME]%>/" -i $file_name
11 sed "s/host =.*$/host = <%=node[:HOST_NAME]%>/" -i $file_name
12 sed "s#mon addr =.*:#mon addr = <%=node[:PUBLIC_IP]%>:#" -i $file_name
13 sed "s#public addr =.*:#public addr = <%=node[:PUBLIC_IP]%>:#" -i $file_name
14 sed "s#cluster addr =.*:#cluster addr = <%=node[:PRIVATE_IP]%>:#" -i $file_name
15 mv $file_name $file_name$SUFFIX
16 fi
17}
18
19ceph-setup_chefsolo_template() {
20 file_name=$1
21 if [ -e $file_name ]; then
22 sed "s/^HOST_NAME.*$/HOST_NAME= <%=node[:HOST_NAME]%> /" -i $file_name
23 sed "s/^PUBLIC_IP.*$/PUBLIC_IP= <%=node[:PUBLIC_IP]%>/" -i $file_name
24 mv $file_name $file_name$SUFFIX
25 fi
26}
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/cinder-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/cinder-template.inc
deleted file mode 100644
index 4aeb616..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/cinder-template.inc
+++ /dev/null
@@ -1,21 +0,0 @@
1#Cinder related configuration functions
2cinder-conf_chefsolo_template() {
3 file_name=$1
4 if [ -e $file_name ]; then
5 sed "s/$DB_USER:/<%=node[:DB_USER]%>:/g" -i $file_name
6 sed "s/$DB_PASSWORD@/<%=node[:DB_PASSWORD]%>@/g" -i $file_name
7 sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name
8 mv $file_name $file_name$SUFFIX
9 fi
10}
11
12cinder-api_chefsolo_template() {
13 file_name=$1
14 if [ -e $file_name ]; then
15 sed "s/^admin_tenant_name =.*$/admin_tenant_name = <%=node[:SERVICE_TENANT_NAME]%> /" -i $file_name
16 sed "s/^admin_user =.*$/admin_user = <%=node[:SERVICE_USER]%> /" -i $file_name
17 sed "s/^admin_password =.*$/admin_password = <%=node[:SERVICE_PASSWORD]%> /" -i $file_name
18 mv $file_name $file_name$SUFFIX
19 fi
20}
21
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/constants.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/constants.inc
deleted file mode 100644
index 48994d3..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/constants.inc
+++ /dev/null
@@ -1,23 +0,0 @@
1#This file is used in the generation of config script
2CONTROLLER_HOST="%CONTROLLER_HOST%"
3COMPUTE_HOST="%COMPUTE_HOST%"
4CONTROLLER_IP="%CONTROLLER_IP%"
5COMPUTE_IP="%COMPUTE_IP%"
6
7DB_USER="%DB_USER%"
8DB_PASSWORD="%DB_PASSWORD%"
9ADMIN_USER="%ADMIN_USER%"
10ADMIN_TENANT_NAME="%ADMIN_PASSWORD%"
11
12ADMIN_PASSWORD="%ADMIN_PASSWORD%"
13SERVICE_PASSWORD="%SERVICE_PASSWORD%"
14SERVICE_TENANT_NAME="%SERVICE_TENANT_NAME%"
15
16SERVICE_USER="%SERVICE_USER%"
17SERVICE_TOKEN="%SERVICE_TOKEN%"
18DEMO_USER="%DEMO_USER%"
19DEMO_PASSWORD="%DEMO_PASSWORD%"
20
21OS_TENANT_NAME="%OS_TENANT_NAME%"
22OS_USERNAME="%OS_USERNAME%"
23OS_PASSWORD="%OS_PASSWORD%"
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/glance-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/glance-template.inc
deleted file mode 100644
index cbf3264..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/glance-template.inc
+++ /dev/null
@@ -1,16 +0,0 @@
1#Glance related configuration functions
2glance_chefsolo_template() {
3 file_name=$1
4 if [ -e $file_name ]; then
5 sed "s/$DB_USER:/<%=node[:DB_USER]%>:/g" -i $file_name
6 sed "s/$DB_PASSWORD@/<%=node[:DB_PASSWORD]%>@/g" -i $file_name
7 sed "s/^swift_store_user =.*$/swift_store_user = <%=node[:SERVICE_TENANT_NAME]%>:glance/" -i $file_name
8 sed "s/^swift_store_key =.*$/swift_store_key = <%=node[:SERVICE_PASSWORD]%> /" -i $file_name
9
10 sed "s/^admin_tenant_name =.*$/admin_tenant_name = <%=node[:SERVICE_TENANT_NAME]%> /" -i $file_name
11 sed "s/^admin_user =.*$/admin_user = <%=node[:SERVICE_USER]%> /" -i $file_name
12 sed "s/^admin_password =.*$/admin_password = <%=node[:SERVICE_PASSWORD]%> /" -i $file_name
13 sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name
14 mv $file_name $file_name$SUFFIX
15 fi
16}
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/heat-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/heat-template.inc
deleted file mode 100644
index 578d2e7..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/heat-template.inc
+++ /dev/null
@@ -1,15 +0,0 @@
1#Heat related configuration function(s)
2heat-conf_chefsolo_template() {
3 file_name=$1
4 if [ -e $file_name ]; then
5 sed "s/$DB_USER:/<%=node[:DB_USER]%>:/g" -i $file_name
6 sed "s/$DB_PASSWORD@/<%=node[:DB_PASSWORD]%>@/g" -i $file_name
7 sed "s/^auth_host =.*$/auth_host = <%=node[:CONTROLLER_IP]%> /" -i $file_name
8 sed "s/^admin_tenant_name =.*$/admin_tenant_name = <%=node[:SERVICE_TENANT_NAME]%> /" -i $file_name
9 sed "s/^admin_password =.*$/admin_password = <%=node[:ADMIN_PASSWORD]%> /" -i $file_name
10 sed "s/$CONTROLLER_IP/<%=node[:CONTROLLER_IP]%>/g" -i $file_name
11 sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name
12 mv $file_name $file_name$SUFFIX
13 fi
14}
15
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/hosts-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/hosts-template.inc
deleted file mode 100644
index b7690b8..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/hosts-template.inc
+++ /dev/null
@@ -1,10 +0,0 @@
1#Hosts related configuration function(s)
2hosts_chefsolo_template() {
3 file_name=$1
4 if [ -e $file_name ]; then
5 sed "s/$CONTROLLER_IP.*$/<%=node[:CONTROLLER_IP]%> <%=node[:CONTROLLER_HOST]%>/" -i $file_name
6 sed "s/$COMPUTE_IP*$/<%=node[:COMPUTE_IP]%> <%=node[:COMPUTE_HOST]%>/" -i $file_name
7 mv $file_name $file_name$SUFFIX
8 fi
9}
10
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/keystone-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/keystone-template.inc
deleted file mode 100644
index dc43639..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/keystone-template.inc
+++ /dev/null
@@ -1,24 +0,0 @@
1#Keystone related configuration functions
2keystone-conf_chefsolo_template() {
3 file_name=$1
4 if [ -e $file_name ]; then
5 #keystone.conf related
6 sed "s/^admin_token =.*$/admin_token=<%=node[:SERVICE_TOKEN]%> /" -i $file_name
7 sed "s/$DB_USER:/<%=node[:DB_USER]%>:/g" -i $file_name
8 sed "s/$DB_PASSWORD@/<%=node[:DB_PASSWORD]%>@/g" -i $file_name
9 mv $file_name $file_name$SUFFIX
10 fi
11}
12
13keystone-identity_chefsolo_template() {
14 file_name=$1
15 if [ -e $file_name ]; then
16 #Identifyy related substitutions
17 sed "s/^export OS_SERVICE_TOKEN.*$/export OS_SERVICE_TOKEN=<%=node[:SERVICE_TOKEN]%>/" \
18 -i $file_name
19 sed "s/$ADMIN_PASSWORD/<%=node[:ADMIN_PASSWORD]%>/" -i $file_name
20 sed "s/$SERVICE_TENANT_NAME/<%=node[:SERVICE_TENANT_NAME]%>/" -i $file_name
21 sed "s/^KEYSTONE_HOST.*$/KEYSTONE_HOST=<%=node[:CONTROLLER_IP]%> /" -i $file_name
22 mv $file_name $file_name$SUFFIX
23 fi
24}
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/neutron-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/neutron-template.inc
deleted file mode 100644
index 4d10607..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/neutron-template.inc
+++ /dev/null
@@ -1,24 +0,0 @@
1#Neutron chefsolo template generation related function(s)
2neutron-conf_chefsolo_template() {
3 file_name=$1
4 if [ -e $file_name ]; then
5 sed "s/admin_tenant_name =.*$/admin_tenant_name = <%=node[:SERVICE_TENANT_NAME]%>/" -i $file_name
6 sed "s/^admin_tenant_name =.*$/admin_tenant_name = <%=node[:SERVICE_TENANT_NAME]%>/" -i $file_name
7 sed "s/^admin_user =.*$/admin_user = <%=node[:SERVICE_USER]%>/" -i $file_name
8 sed "s/^admin_password =.*$/admin_password =<%=node[:SERVICE_PASSWORD]%>/g" -i $file_name
9 sed "s/^rabbit_host =.*$/rabbit_host = <%=node[:CONTROLLER_IP]%>/" -i $file_name
10 mv $file_name $file_name$SUFFIX
11 fi
12}
13
14neutron-plugins_chefsolo_template() {
15 file_name=$1
16 if [ -e $file_name ]; then
17 sed "s/$DB_USER:/<%=node[:DB_USER]%>:/g" -i $file_name
18 sed "s/$DB_PASSWORD@/<%=node[:DB_PASSWORD]%>@/g" -i $file_name
19 sed "s/$CONTROLLER_IP/<%=node[:CONTROLLER_IP]%>/g" -i $file_name
20 sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name
21 mv $file_name $file_name$SUFFIX
22 fi
23}
24
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/nova-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/nova-template.inc
deleted file mode 100644
index 74b0d4c..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/nova-template.inc
+++ /dev/null
@@ -1,47 +0,0 @@
1#Nova chefsolo template generation functions
2openrc_chefsolo_template() {
3 file_name=$1
4 if [ -e $file_name ]; then
5 sed "s/^export OS_TENANT_NAME=.*$/export OS_TENANT_NAME=<%=node[:OS_TENANT_NAME]%> /" -i $file_name
6 sed "s/^export OS_USERNAME=.*$/export OS_USERNAME=<%=node[:OS_USERNAME]%> /" -i $file_name
7 sed "s/^export OS_PASSWORD=.*$/export OS_PASSWORD=<%=node[:OS_PASSWORD]%> /" -i $file_name
8 sed "s/^export SERVICE_TOKEN=.*$/export SERVICE_TOKEN=<%=node[:SERVICE_TOKEN]%> /" -i $file_name
9 sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name
10 mv $file_name $file_name$SUFFIX
11 fi
12}
13
14nova-conf_chefsolo_template() {
15 file_name=$1
16 if [ -e $file_name ]; then
17 sed "s/$CONTROLLER_IP/<%=node[:CONTROLLER_IP]%>/g" -i $file_name
18 sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name
19 sed "s/$COMPUTE_IP/<%=node[:COMPUTE_IP]%>/g" -i $file_name
20 sed "s/$DB_USER:/<%=node[:DB_USER]%>:/g" -i $file_name
21 sed "s/$DB_PASSWORD@/<%=node[:DB_PASSWORD]%>@/g" -i $file_name
22 mv $file_name $file_name$SUFFIX
23 fi
24}
25
26api-paste_chefsolo_template() {
27 file_name=$1
28 if [ -e $file_name ]; then
29 sed "s/auth_host =.*$/auth_host = <%=node[:CONTROLLER_IP]%> /" -i $file_name
30 sed "s/^admin_tenant_name =.*$/admin_tenant_name = <%=node[:SERVICE_TENANT_NAME]%> /" -i $file_name
31 sed "s/^admin_user =.*$/admin_user = <%=node[:SERVICE_USER]%> /" -i $file_name
32 sed "s/^admin_password =.*$/admin_password = <%=node[:SERVICE_PASSWORD]%> /" -i $file_name
33 sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name
34 mv $file_name $file_name$SUFFIX
35 fi
36}
37
38deploy-conf_chefsolo_template() {
39 file_name=$1
40 if [ -e $file_name ]; then
41 sed "s/$CONTROLLER_IP/<%=node[:CONTROLLER_IP]%>/g" -i $file_name
42 sed "s/$CONTROLLER_HOST/<%=node[:CONTROLLER_HOST]%>/g" -i $file_name
43 sed "s/$COMPUTE_IP/<%=node[:COMPUTE_IP]%>/g" -i $file_name
44 sed "s/$COMPUTE_HOST/<%=node[:COMPUTE_HOST]%>/g" -i $file_name
45 mv $file_name $file_name$SUFFIX
46 fi
47}
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/postgresql-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/postgresql-template.inc
deleted file mode 100644
index 6022cd2..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/postgresql-template.inc
+++ /dev/null
@@ -1,12 +0,0 @@
1#Postgresql chefsolo template generation functions
2postgresql_chefsolo_template() {
3 file_name=$1
4 if [ -e $file_name ]; then
5 sed "s/$CONTROLLER_IP/<%=node[:CONTROLLER_IP]%>/g" -i $file_name
6 sed "s/$COMPUTE_IP/<%=node[:COMPUTE_IP]%>/g" -i $file_name
7 sed "s/^DB_USER=.*$/DB_USER=<%=node[:DB_USER]%>/" -i $file_name
8 sed "s/^DB_PASSWORD=.*$/DB_PASSWORD=<%=node[:DB_PASSWORD]%>/" -i $file_name
9 mv $file_name $file_name$SUFFIX
10 fi
11}
12
diff --git a/meta-openstack/recipes-support/deploychef/files/conf-templates/swift-template.inc b/meta-openstack/recipes-support/deploychef/files/conf-templates/swift-template.inc
deleted file mode 100644
index 4a33536..0000000
--- a/meta-openstack/recipes-support/deploychef/files/conf-templates/swift-template.inc
+++ /dev/null
@@ -1,37 +0,0 @@
1#Swift chefso template generation functions
2dispersion-conf_chefsolo_template() {
3 file_name=$1
4 if [ -e $file_name ]; then
5 sed "s/$SERVICE_TENANT_NAME/<%=node[:SERVICE_TENANT_NAME]%>/" -i $file_name
6 sed "s/$SERVICE_USER/<%=node[:SERVICE_USER]%>/" -i $file_name
7 sed "s/$SERVICE_PASSWORD/<%=node[:SERVICE_PASSWORD]%>/" -i $file_name
8 mv $file_name $file_name$SUFFIX
9 fi
10}
11
12test-conf_chefsolo_template() {
13 file_name=$1
14 if [ -e $file_name ]; then
15 sed "s/^account =.*$/account = <%=node[:ADMIN_TENANT_NAME]%>/" -i $file_name
16 sed "s/^username =.*$/username = <%=node[:ADMIN_USER]%>/" -i $file_name
17 sed "s/^password =.*$/password = <%=node[:ADMIN_PASSWORD]%>/g" -i $file_name
18
19 sed "s/^account2 =.*$/account = <%=node[:SERVICE_TENANT_NAME]%>/" -i $file_name
20 sed "s/^username2 =.*$/username = <%=node[:SERVICE_USER]%>/" -i $file_name
21 sed "s/^password2 =.*$/password = <%=node[:SERVICE_PASSWORD]%>/g" -i $file_name
22
23 sed "s/^username3 =.*$/username = <%=node[:DEMO_USER]%>/" -i $file_name
24 sed "s/^password3 =.*$/password = <%=node[:DEMO_PASSWORD]%>/g" -i $file_name
25 mv $file_name $file_name$SUFFIX
26 fi
27}
28
29proxy-server_chefsolo_template() {
30 file_name=$1
31 if [ -e $file_name ]; then
32 sed "s/^admin_tenant_name =.*$/admin_tenant_name = <%=node[:SERVICE_TENANT_NAME]%> /" -i $file_name
33 sed "s/^admin_user =.*$/admin_user = <%=node[:SERVICE_USER]%> /" -i $file_name
34 sed "s/^admin_password =.*$/admin_password = <%=node[:SERVICE_PASSWORD]%> /" -i $file_name
35 mv $file_name $file_name$SUFFIX
36 fi
37}
diff --git a/meta-openstack/recipes-support/deploychef/files/generate-templates b/meta-openstack/recipes-support/deploychef/files/generate-templates
deleted file mode 100644
index 178c8c3..0000000
--- a/meta-openstack/recipes-support/deploychef/files/generate-templates
+++ /dev/null
@@ -1,274 +0,0 @@
1#!/bin/bash
2#Location of servics configuration files
3D="%SYSCONFDIR%"
4TEMPLATES="%DEPLOYCHEF_ROOT_DIR%/cookbooks/openstack/templates/default"
5#Chefsolo template suffix
6SUFFIX='.erb'
7#List of services whose config files needs to be converted to templates
8service_list="ceph swift nova heat cinder keystone glance neutron ceilometer init.d"
9source %DEPLOYCHEF_ROOT_DIR%/conf-templates/constants.inc
10source %DEPLOYCHEF_ROOT_DIR%/conf-templates/nova-template.inc
11source %DEPLOYCHEF_ROOT_DIR%/conf-templates/ceph-template.inc
12source %DEPLOYCHEF_ROOT_DIR%/conf-templates/swift-template.inc
13source %DEPLOYCHEF_ROOT_DIR%/conf-templates/neutron-template.inc
14source %DEPLOYCHEF_ROOT_DIR%/conf-templates/ceilometer-template.inc
15source %DEPLOYCHEF_ROOT_DIR%/conf-templates/glance-template.inc
16source %DEPLOYCHEF_ROOT_DIR%/conf-templates/postgresql-template.inc
17source %DEPLOYCHEF_ROOT_DIR%/conf-templates/keystone-template.inc
18source %DEPLOYCHEF_ROOT_DIR%/conf-templates/cinder-template.inc
19source %DEPLOYCHEF_ROOT_DIR%/conf-templates/heat-template.inc
20source %DEPLOYCHEF_ROOT_DIR%/conf-templates/hosts-template.inc
21
22SRC="${D}/%POSTINSTS_DIR%/"
23DST=${TEMPLATES}
24#Copy postinstall scripts and make chefsolo templates
25postinsts_make_templates(){
26 for file in $(ls -h ${SRC}); do
27 dst_file=${DST}/$file$SUFFIX
28 install -m 0644 ${SRC}/$file $dst_file
29 sed 's|ADMIN_PASSWORD=.*$|ADMIN_PASSWORD=<%=node[:ADMIN_PASSWORD]%> \\|' -i $dst_file
30 sed 's|SERVICE_PASSWORD=.*$|SERVICE_PASSWORD=<%=node[:SERVICE_PASSWORD]%> \\|' -i $dst_file
31 sed 's|SERVICE_TENANT_NAME=.*$|SERVICE_TENANT_NAME=<%=node[:SERVICE_TENANT_NAME]%> \\|' -i $dst_file
32 sed "s|$CONTROLLER_IP|<%=node[:CONTROLLER_IP]%>|g" -i $dst_file
33 sed "s|$CONTROLLER_HOST|<%=node[:CONTROLLER_HOST]%>|g" -i $dst_file
34 done
35}
36
37#These sets of make_*_templates() helper functions
38#copy the respective configuration files if they
39#exist and converts them to chefsolo templates
40etc-hosts_make_templates(){
41 #Creat template file for /etc/hosts
42 SRC=${D}
43 DST=${TEMPLATES}
44 file_name=hosts
45 install -m 0644 ${SRC}/$file_name ${DST}
46 file_name="${DST}/$file_name"
47 hosts_chefsolo_template $file_name
48}
49
50make_ceph_templates(){
51 file_name=ceph.conf
52 if [ -f ${SRC}/$file_name ]; then
53 install -m 0644 ${SRC}/$file_name ${DST}
54 file_name="${DST}/$file_name"
55 ceph-conf_chefsolo_template $file_name
56 fi
57 file_name=ceph-setup
58 if [ -f ${SRC}/$file_name ]; then
59 install -m 0644 ${SRC}/../init.d/$file_name ${DST}
60 file_name="${DST}/$file_name"
61 ceph-setup_chefsolo_template $file_name
62 fi
63}
64
65make_swift_templates(){
66 file_name='test.conf'
67 if [ -f ${SRC}/$file_name ]; then
68 install -m 0644 ${SRC}/$file_name ${DST}
69 file_name="${DST}/$file_name"
70 test-conf_chefsolo_template $file_name
71 fi
72
73 file_name='dispersion.conf'
74 if [ -f ${SRC}/$file_name ]; then
75 install -m 0644 ${SRC}/$file_name ${DST}
76 file_name="${DST}/$file_name"
77 dispersion-conf_chefsolo_template $file_name
78 fi
79 file_name='proxy-server.conf'
80 if [ -f ${SRC}/$file_name ]; then
81 install -m 0644 ${SRC}/$file_name ${DST}
82 file_name="${DST}/$file_name"
83 proxy-server_chefsolo_template $file_name
84 fi
85}
86
87make_nova_templates(){
88 file_name=nova.conf
89 if [ -f ${SRC}/$file_name ]; then
90 install -m 0644 ${SRC}/$file_name ${DST}
91 file_name="${DST}/$file_name"
92 nova-conf_chefsolo_template $file_name
93 fi
94 file_name=openrc
95 if [ -f ${SRC}/$file_name ]; then
96 install -m 0644 ${SRC}/$file_name ${DST}
97 file_name="${DST}/$file_name"
98 openrc_chefsolo_template $file_name
99 fi
100 file_name=api-paste.ini
101 if [ -f ${SRC}/$file_name ]; then
102 install -m 0644 ${SRC}/$file_name ${DST}
103 file_name="${DST}/$file_name"
104 api-paste_chefsolo_template $file_name
105 fi
106
107 file_name=deploy.conf
108 if [ -f ${SRC}/$file_name ]; then
109 install -m 0644 ${SRC}/$file_name ${DST}
110 file_name="${DST}/$file_name"
111 deploy-conf_chefsolo_template $file_name
112 fi
113}
114
115make_neutron_templates(){
116 file_name=neutron.conf
117 install -m 0644 ${SRC}/$file_name ${DST}
118 file_name="${DST}/$file_name"
119 neutron-conf_chefsolo_template $file_name
120 if [ -d ${SRC}/plugins/openvswitch ]; then
121 file_name=ovs_neutron_plugin.ini
122 install -m 0644 ${SRC}/plugins/openvswitch/$file_name ${DST}
123 file_name="${DST}/$file_name"
124 neutron-plugins_chefsolo_template $file_name
125 fi
126
127 if [ -d ${SRC}/plugins/linuxbridge ]; then
128 file_name=linuxbridge_conf.ini
129 install -m 0644 ${SRC}/plugins/linuxbridge/$file_name ${DST}
130 file_name="${DST}/$file_name"
131 neutron-plugins_chefsolo_template $file_name
132 fi
133}
134make_heat_templates(){
135 file_name=heat.conf
136 if [ -f ${SRC}/$file_name ]; then
137 install -m 0644 ${SRC}/$file_name ${DST}
138 file_name="${DST}/$file_name"
139 heat-conf_chefsolo_template $file_name
140 fi
141}
142
143make_cinder_templates(){
144 file_name=api-paste.ini
145 if [ -f ${SRC}/$file_name ]; then
146 install -m 0644 ${SRC}/$file_name ${DST}/${file_name}.cinder
147 file_name="${DST}/${file_name}.cinder"
148 cinder-api_chefsolo_template $file_name
149 fi
150
151 file_name=cinder.conf
152 if [ -f ${SRC}/$file_name ]; then
153 install -m 0644 ${SRC}/$file_name ${DST}
154 file_name="${DST}/$file_name"
155 cinder-conf_chefsolo_template $file_name
156 fi
157}
158make_keystone_templates(){
159 file_name=keystone.conf
160 if [ -f ${SRC}/$file_name ]; then
161 install -m 0644 ${SRC}/$file_name ${DST}
162 file_name="${DST}/$file_name"
163 keystone-conf_chefsolo_template $file_name
164 fi
165 file_name=identity.sh
166 if [ -f ${SRC}/$file_name ]; then
167 install -m 0644 ${SRC}/$file_name ${DST}
168 file_name="${DST}/$file_name"
169 keystone-identity_chefsolo_template $file_name
170 fi
171}
172make_glance_templates(){
173 file_name=glance-api.conf
174 if [ -f ${SRC}/$file_name ]; then
175 install -m 0644 ${SRC}/$file_name ${DST}
176 file_name="${DST}/$file_name"
177 glance_chefsolo_template $file_name
178 fi
179
180 file_name=glance-cache.conf
181 if [ -f ${SRC}/$file_name ]; then
182 install -m 0644 ${SRC}/$file_name ${DST}
183 file_name="${DST}/$file_name"
184 glance_chefsolo_template $file_name
185 fi
186 file_name=glance-registry.conf
187 if [ -f ${SRC}/$file_name ]; then
188 install -m 0644 ${SRC}/$file_name ${DST}
189 file_name="${DST}/$file_name"
190 glance_chefsolo_template $file_name
191 fi
192}
193
194make_ceilometer_templates(){
195
196 file_name=ceilometer.conf
197 if [ -f ${SRC}/$file_name ]; then
198 install -m 0644 ${SRC}/$file_name ${DST}
199 file_name="${DST}/$file_name"
200 ceilometer-conf_chefsolo_template $file_name
201 fi
202}
203
204make_postgresql_templates(){
205
206 file_name=postgresql-init
207 if [ -f ${SRC}/$file_name ]; then
208 install -m 0644 ${SRC}/$file_name ${DST}
209 file_name="${DST}/$file_name"
210 postgresql_chefsolo_template $file_name
211 fi
212}
213
214
215#This function installs the config/script files of services
216#and converts them into templates.
217services-conf_make_templates(){
218 for mod in ${service_list}; do
219 if [ -d ${D}/$mod ]; then
220 SRC=${D}/$mod
221 DST=${TEMPLATES}
222 case $mod in
223 ceph)
224 #Copy ceph configuration files and convert them to templates
225 make_ceph_templates
226 ;;
227 swift)
228 #Copy swift configuration files and convert them into
229 #chefsolo templates
230 make_swift_templates
231
232 ;;
233 nova)
234 #Copy nova configuration files and convert them into
235 #chefsolo templates
236 make_nova_templates
237 ;;
238 neutron)
239 #Copy neutron configuration files and convert them into
240 #chefsolo templates
241 make_neutron_templates
242 ;;
243 heat)
244 make_heat_templates
245 ;;
246 cinder)
247 make_cinder_templates
248 ;;
249 keystone)
250 make_keystone_templates
251 ;;
252 glance)
253 #Copy glance configuration files and convert them into
254 #chefsolo templates
255 make_glance_templates
256 ;;
257 ceilometer)
258 make_ceilometer_templates
259 ;;
260 init.d)
261 make_postgresql_templates
262 ;;
263 *)
264 ;;
265 esac
266 echo "Service present in $mod"
267 fi
268 done
269}
270
271install -d ${TEMPLATES}
272postinsts_make_templates
273etc-hosts_make_templates
274services-conf_make_templates