Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial configuration for iRes chef

  • Loading branch information...
commit 7985671d3a0e51ebe3328682d0494b4608facb0e 0 parents
@phuongnd08 authored
Showing with 81 additions and 0 deletions.
  1. +40 −0 install.sh
  2. +35 −0 node.json
  3. +6 −0 solo.rb
40 install.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Cloud init script for Amazon AMI
+
+# Install ruby necessary libs
+apt-get update
+apt-get install -y ruby ruby-dev libopenssl-ruby rdoc ri irb build-essential wget ssl-cert curl
+
+export PATH=$PATH:/usr/local/bin
+
+if [ -f `which gem` ]
+then
+ echo 'Rubygems installed'
+else
+ echo 'Install rubygems'
+ mkdir ~/tmp
+ cd ~/tmp
+ rm -rf rubygems*
+ wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.12.tgz
+ tar -xzf rubygems-1.8.12.tgz
+ cd rubygems*
+ ruby setup.rb
+ cd ~
+ rm -rf ~/tmp
+fi
+
+if [ -f `which chef-solo` ]
+then
+ echo 'Chef installed'
+else
+ echo 'Install chef'
+ gem install chef --no-rdoc --no-ri
+fi
+
+#echo 'Clone original formula'
+#git clone git@github.com:Shopximity/internal-chef.git
+#cd internal-chef
+
+echo 'Start chef-solo:'
+cd `dirname $0`
+chef-solo -c solo.rb
35 node.json
@@ -0,0 +1,35 @@
+{
+ "run_list": [
+ "recipe[ires]"
+ ],
+ "rvm": {
+ "install_rubies": true,
+ "rubies": [
+ "1.9.3"
+ ]
+ },
+ "rvm_passenger": {
+ "rvm_ruby": "1.9.3"
+ },
+ "nginx": {
+ "version": "1.0.10",
+ "user": "root"
+ },
+ "monit":{
+ "polling_frequency": 120
+ },
+ "node_name": "server.ires.com",
+ "host": "localhost",
+ "user": "root",
+ "rails_env": "production",
+ "rvm_ruby": "1.9.3",
+ "current_app": {
+ "id": "ires",
+ "deploy_to": "/home/data/ires",
+ "owner": "deploy",
+ "group": "deploy",
+ "repository": "git://github.com/phuongnd08/iRes.git",
+ "revision": "master",
+ "force": false
+ }
+}
6 solo.rb
@@ -0,0 +1,6 @@
+cookbook_path File.expand_path("../cookbooks", __FILE__)
+json_attribs File.expand_path("../node.json", __FILE__)
+log_level :info
+log_location STDOUT
+verbose_logging :debug
+Chef::Config[:node_name] = "fuck.ires.com"
Please sign in to comment.
Something went wrong with that request. Please try again.