Browse files

initial version of chef-server recipe

  • Loading branch information...
1 parent 2d68b98 commit 034159c2e84f72ff28b42bcdd43ed8aa285677a3 @avishai-ish-shalom avishai-ish-shalom committed Apr 14, 2012
View
1 service-recipes/chef-server/README.md
@@ -0,0 +1 @@
+# Chef server installation
View
33 service-recipes/chef-server/chef-server-service.groovy
@@ -0,0 +1,33 @@
+/*******************************************************************************
+* Copyright (c) 2011 GigaSpaces Technologies Ltd. All rights reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*******************************************************************************/
+service {
+ extend "../../../cloudify-recipes/service-recipes/chef"
+ name "chef_server"
+ type "WEB_SERVER"
+ numInstances 1
+ compute {
+ template "MEDIUM_LINUX_CHEF_SERVER"
+ }
+ lifecycle{
+ preInstall "chef_server_preInstall.groovy"
+ install "chef_server_install.groovy"
+ start { while (true) { sleep(5000) } }
+ startDetection {
+ !ServiceUtils.arePortsFree([4000, 443] )
+ }
+ }
+
+}
View
17 service-recipes/chef-server/chef_server_install.groovy
@@ -0,0 +1,17 @@
+import org.cloudifysource.dsl.context.ServiceContextFactory
+
+def context = ServiceContextFactory.getServiceContext()
+
+bootstrap = ChefBootstrap.getBootstrap(installFlavor:"gem")
+bootstrap.runSolo([
+ "chef_server": [
+ "server_url": "http://localhost:4000",
+ "init_style": "runit"
+ ],
+ "run_list": ["recipe[build-essential]", "recipe[chef-server::rubygems-install]", "recipe[chef-server::apache-proxy]" ]
+])
+
+
+// eventually we will want to use a global attribute
+// context.attributes.thisApplication["validation.pem"] = new File("/etc/chef/validation.pem").text
+
View
6 service-recipes/chef-server/chef_server_preInstall.groovy
@@ -0,0 +1,6 @@
+import org.cloudifysource.dsl.context.ServiceContextFactory
+
+def context = ServiceContextFactory.getServiceContext()
+ChefBootstrap.getBootstrap(
+ installFlavor:"gem"
+).install()

0 comments on commit 034159c

Please sign in to comment.