[from now] Thu Dec 26 10:05:17 JST 2013

diff --git a/chef/Berksfile b/chef/Berksfile
index b506fc7..67fe13b 100644
--- a/chef/Berksfile
+++ b/chef/Berksfile
@@ -7,3 +7,4 @@ cookbook 'nginx'
 cookbook 'rbenv'
 cookbook 'mysql'
 cookbook 'database'
+cookbook 'ntp'
diff --git a/chef/Berksfile.lock b/chef/Berksfile.lock
index c156838..745c8b4 100644
--- a/chef/Berksfile.lock
+++ b/chef/Berksfile.lock
@@ -21,6 +21,9 @@
     "database": {
       "locked_version": "1.5.2"
     },
+    "ntp": {
+      "locked_version": "1.5.0"
+    },
     "apt": {
       "locked_version": "2.3.0"
     },
diff --git a/chef/roles/default.json b/chef/roles/default.json
index 1145923..0ff68e8 100644
--- a/chef/roles/default.json
+++ b/chef/roles/default.json
@@ -7,14 +7,30 @@
   "build_essential": {
     "compiletime": "true"
   },
+  "override_attributes": {
+    "rbenv": {
+      "user": "yukkuri",
+      "group": "yukkuri",
+      "root": "/home/yukkuri/rbenv",
+      "group_users": ["yukkuri"],
+      "install_prefix": "/home/yukkuri",
+      "version": "2.1.0-rc1"
+    },
+    "ntp": {
+      "servers": [
+        "ntp.nict.jp"
+      ]
+    }
+  },
   "run_list": [
     "add-basic-user",
     "build-essential",
     "sudo",
     "basic-packages",
+    "basic-settings",
+    "ntp",
     "build-ruby",
     "ssh-config",
-    "my-iptables",
     "prepare-to-deploy"
   ]
 }
diff --git a/chef/roles/webserver.json b/chef/roles/webserver.json
index 786f5c2..1550430 100644
--- a/chef/roles/webserver.json
+++ b/chef/roles/webserver.json
@@ -1,20 +1,11 @@
 {
   "name": "webserver",
-  "default_attributes": {
-    "tz": "Asia/Tokyo"
-  },
   "override_attributes": {
+    "tz": "Asia/Tokyo",
     "mysql": {
       "client": {
         "packages": ["mysql-client", "libmysqlclient-dev"]
       }
-    },
-    "rbenv": {
-      "user": "yukkuri",
-      "group": "yukkuri",
-      "group_users": ["yukkuri"],
-      "install_prefix": "/home/yukkuri",
-      "version": "2.1.0-rc1"
     }
   },
   "json_class": "Chef::Role",
@@ -24,6 +15,7 @@
     "mysql::client",
     "mysql::server",
     "mysql-ruby",
-    "configure-mysql"
+    "configure-mysql",
+    "after-treatment"
   ]
 }
diff --git a/chef/site-cookbooks/build-ruby/recipes/default.rb b/chef/site-cookbooks/build-ruby/recipes/default.rb
index 0e45f87..8f86672 100644
--- a/chef/site-cookbooks/build-ruby/recipes/default.rb
+++ b/chef/site-cookbooks/build-ruby/recipes/default.rb
@@ -17,13 +17,6 @@ rbenv_ruby node[:rbenv][:version] do
   # global true
 end

-execute "rbenv.global" do
-  not_if { File.exists?("/home/yukkuri/rbenv/versions/#{node[:rbenv][:version]}") }
-  cwd "/home/yukkuri"
-  user "yukkuri"
-  command "/home/yukkuri/rbenv/bin/rbenv global '#{node[:rbenv][:version]}'"
-end
-
 package "gem" do
   action :install
 end
diff --git a/chef/site-cookbooks/my-iptables/CHANGELOG.md b/chef/site-cookbooks/my-iptables/CHANGELOG.md
deleted file mode 100644
index d748a90..0000000
--- a/chef/site-cookbooks/my-iptables/CHANGELOG.md
+++ /dev/null
@@ -1,13 +0,0 @@
-iptables CHANGELOG
-==================
-
-This file is used to list changes made in each version of the iptables cookbook.
-
-0.1.0
------
-- [your_name] - Initial release of iptables
-
-- - -
-Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.
-
-The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.
diff --git a/chef/site-cookbooks/my-iptables/README.md b/chef/site-cookbooks/my-iptables/README.md
deleted file mode 100644
index b962a99..0000000
--- a/chef/site-cookbooks/my-iptables/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-iptables Cookbook
-=================
-TODO: Enter the cookbook description here.
-
-e.g.
-This cookbook makes your favorite breakfast sandwhich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-e.g.
-#### packages
-- `toaster` - iptables needs toaster to brown your bagel.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-e.g.
-#### iptables::default
-<table>
-  <tr>
-    <th>Key</th>
-    <th>Type</th>
-    <th>Description</th>
-    <th>Default</th>
-  </tr>
-  <tr>
-    <td><tt>['iptables']['bacon']</tt></td>
-    <td>Boolean</td>
-    <td>whether to include bacon</td>
-    <td><tt>true</tt></td>
-  </tr>
-</table>
-
-Usage
------
-#### iptables::default
-TODO: Write usage instructions for each cookbook.
-
-e.g.
-Just include `iptables` in your node's `run_list`:
-
-```json
-{
-  "name":"my_node",
-  "run_list": [
-    "recipe[iptables]"
-  ]
-}
-```
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write you change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
diff --git a/chef/site-cookbooks/my-iptables/metadata.rb b/chef/site-cookbooks/my-iptables/metadata.rb
deleted file mode 100644
index c26551d..0000000
--- a/chef/site-cookbooks/my-iptables/metadata.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-name             'my-iptables'
-maintainer       'YOUR_COMPANY_NAME'
-maintainer_email 'YOUR_EMAIL'
-license          'All rights reserved'
-description      'Installs/Configures iptables'
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version          '0.1.0'
-
-depends          'iptables'
\ No newline at end of file
diff --git a/chef/site-cookbooks/my-iptables/recipes/default.rb b/chef/site-cookbooks/my-iptables/recipes/default.rb
deleted file mode 100644
index 746d501..0000000
--- a/chef/site-cookbooks/my-iptables/recipes/default.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Cookbook Name:: iptables
-# Recipe:: default
-#
-# Copyright 2013, YOUR_COMPANY_NAME
-#
-# All rights reserved - Do Not Redistribute
-#
-
-include_recipe "iptables"
-
-iptables_rule "ssh"
-iptables_rule "http"
\ No newline at end of file
diff --git a/chef/site-cookbooks/my-iptables/templates/default/http.erb b/chef/site-cookbooks/my-iptables/templates/default/http.erb
deleted file mode 100644
index 5678e8f..0000000
--- a/chef/site-cookbooks/my-iptables/templates/default/http.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-# Port 80 for http
--A FWR -p tcp -m tcp --dport 80 -j ACCEPT
\ No newline at end of file
diff --git a/chef/site-cookbooks/my-iptables/templates/default/ssh.erb b/chef/site-cookbooks/my-iptables/templates/default/ssh.erb
deleted file mode 100644
index 548ed07..0000000
--- a/chef/site-cookbooks/my-iptables/templates/default/ssh.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-# Port 22 for ssh
--A FWR -p tcp -m tcp --dport 22 -j ACCEPT
\ No newline at end of file
diff --git a/chef/site-cookbooks/my-iptables/templates/default/vagrant_ssh.erb b/chef/site-cookbooks/my-iptables/templates/default/vagrant_ssh.erb
deleted file mode 100644
index 663de8d..0000000
--- a/chef/site-cookbooks/my-iptables/templates/default/vagrant_ssh.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-# Port 2222 for ssh
--A FWR -p tcp -m tcp --dport 2222 -j ACCEPT
\ No newline at end of file
diff --git a/chef/site-cookbooks/mysql b/chef/site-cookbooks/mysql
deleted file mode 160000
index ed0aecb..0000000
--- a/chef/site-cookbooks/mysql
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit ed0aecbe7fb1b2a1093ac987786e96813122a76a
diff --git a/chef/site-cookbooks/nodes/127.0.0.1.json b/chef/site-cookbooks/nodes/127.0.0.1.json
deleted file mode 100644
index 1f947d1..0000000
--- a/chef/site-cookbooks/nodes/127.0.0.1.json
+++ /dev/null
@@ -1 +0,0 @@
-{"run_list":[]}
\ No newline at end of file
diff --git a/chef/site-cookbooks/rbenv-cookbook b/chef/site-cookbooks/rbenv-cookbook
deleted file mode 160000
index 5f56ed4..0000000
--- a/chef/site-cookbooks/rbenv-cookbook
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 5f56ed4c42e3b45ac87848bfdf530c4e4ea4fb95
add fixed mysql cookbook
modified
rename cookbook
fix a bug in building ruby