{"id":530,"date":"2014-02-12T10:35:17","date_gmt":"2014-02-12T01:35:17","guid":{"rendered":"http:\/\/www.otwo.jp\/blog\/?p=530"},"modified":"2015-01-14T11:38:03","modified_gmt":"2015-01-14T02:38:03","slug":"vagrant-chef-solo","status":"publish","type":"post","link":"https:\/\/www.otwo.jp\/blog\/vagrant-chef-solo\/","title":{"rendered":"Vagrant\u3068chef-solo\u3067\u958b\u767a\u74b0\u5883\u3092\u7acb\u3061\u4e0a\u3052\u308b"},"content":{"rendered":"<p>\u958b\u767a\uff12\u90e8\u306e\u5409\u5ca1\u3067\u3059\u3002<\/p>\n<p>\u524d\u56de\u306e\u8a18\u4e8b <a href=\"http:\/\/www.otwo.jp\/blog\/server\/chef-recipe\/\">rpm\u3092\u4f7f\u3063\u305fchef-solo\u306e\u30ec\u30b7\u30d4\u3092\u4f5c\u6210\u3057\u3066\u3044\u304f<\/a><br \/>\n\u524d\u3005\u56de\u306e\u8a18\u4e8b\u3000<a href=\"http:\/\/www.otwo.jp\/blog\/server\/rpm-server\/\">chef-solo\u3067\u4f7f\u3046rpm\u306e\u914d\u4fe1\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3066\u3066\u307f\u308b<\/a><\/p>\n<p>\u4eca\u56de\u306fVagrant\u3068chef-solo\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u958b\u767a\u74b0\u5883\u3092\u4f5c\u3063\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<!--more--><\/p>\n<h1>git submodule\u3067\u30af\u30c3\u30af\u30d6\u30c3\u30af\u3092\u6301\u3063\u3066\u304f\u308b<\/h1>\n<p><a href=\"http:\/\/www.otwo.jp\/blog\/server\/chef-recipe\/\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u3067\u306f\u3001\u4f5c\u6210\u3057\u305f\u30af\u30c3\u30af\u30d6\u30c3\u30af\u3092git\u306bpush\u3057\u3066\u304a\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>vagrant\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u300cgit init\u300d\u3057\u3066\u304a\u304d\u3001\u30af\u30c3\u30af\u30d6\u30c3\u30af\uff08\u300csite-cookbooks\u300d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff09\u3092submodule\u3068\u3057\u3066\u8ffd\u52a0\u3057\u3066\u3084\u308a\u307e\u3059\u3002<\/p>\n<p>\uff08\u306a\u306e\u3067\u3001\u300ccookbooks\u300d\u306b\u5165\u3063\u3066\u3044\u308b\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u88fd\u306e\u30ec\u30b7\u30d4\u306f\u4f7f\u308f\u306a\u3044\u524d\u63d0\u3067\u3059\uff09<\/p>\n<p>vagrant init\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067<\/p>\n<pre class=\"brush: bash\r; notranslate\">$ git submodule add \u30ec\u30dd\u30b8\u30c8\u30eaURL .\/site-cookbooks\r\n<\/pre>\n<p>\u3068\u3059\u308b\u3068\u3001site-cookbooks\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u4f5c\u6210\u3055\u308c\u3001\u30ec\u30b7\u30d4\u304c\u53d6\u308a\u8fbc\u307e\u308c\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u3068\u3057\u3066\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002<br \/>\n\u2533Vagrantfile<br \/>\n\u2517site-cookbooks<br \/>\n\u2523httpd-rpm<br \/>\n\u2503\u2517\u30af\u30c3\u30af\u30d6\u30c3\u30af\u306e\u30d5\u30a1\u30a4\u30eb\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<br \/>\n\u2523php55-rpm<br \/>\n\u2503\u2517\u30af\u30c3\u30af\u30d6\u30c3\u30af\u306e\u30d5\u30a1\u30a4\u30eb\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<br \/>\n\u2517mysql\u201356-rpm<br \/>\n\u2517 \u30af\u30c3\u30af\u30d6\u30c3\u30af\u306e\u30d5\u30a1\u30a4\u30eb\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/p>\n<h1>Vagrantfile\u306eprovision<\/h1>\n<p>Vagrant\u3068chef-solo\u306e\u9023\u643a\u306f\u3001Vagrantfile\u306eprovision\u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306b\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<pre class=\"brush: ruby\r; notranslate\">  config.vm.provision :chef_solo do |chef|\r\n    chef.cookbooks_path =  [\".\/site-cookbooks\"]\r\n\r\n    chef.add_recipe \"mysql-56-rpm\"\r\n    chef.add_recipe \"httpd-rpm\"\r\n    chef.add_recipe \"php55-rpm\"\r\n\r\n    chef.json = {\r\n      \"httpd\" =&gt; {\r\n        \"ServerName\" =&gt; \"lamp.local.localnet:80\"\r\n      },\r\n\r\n      \"mysql\" =&gt; {\r\n        \"sync_binlog\" =&gt; \"0\",\r\n        \"innodb_buffer_pool_size\" =&gt; \"128M\"\r\n      }\r\n    }\r\n  end\r\n\r\n<\/pre>\n<p>chef.cookbooks_path \u3067cookbook\u306e\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u3001chef.add_recipe\u3067\u4f7f\u7528\u3059\u308b\u30ec\u30b7\u30d4\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001chef.json\u3067attributes\u306e\u8a2d\u5b9a\u3082\u884c\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<h1>\u74b0\u5883\u3092\u4f5c\u3063\u3066\u307f\u308b<\/h1>\n<p>\u3042\u3068\u306f<\/p>\n<pre class=\"brush: bash\r; notranslate\">$ vagrant up\r\n<\/pre>\n<p>\u3059\u308b\u3068\u3001chef-solo\u304c\u9811\u5f35\u3063\u3066\u8a2d\u5b9a\u3057\u3066\u304f\u308c\u308b\u306f\u305a\uff01\u3067\u3059\u3002<\/p>\n<p>\u4ed6\u306e\u30b9\u30bf\u30c3\u30d5\u306b\u74b0\u5883\u3092\u914d\u5e03\u3057\u305f\u3044\u6642\u306f\u3001\u3053\u306evagrant\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30ea\u30e2\u30fc\u30c8\u306b\u300cgit push\u300d\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u914d\u5e03\u5148\u3067<\/p>\n<pre class=\"brush: bash\r; notranslate\">$ git clone vagrant\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306eURL\r\n$ cd clone\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\r\n$ git submodule update --init\r\n$ git submodule foreach 'git pull origin master'\r\n<\/pre>\n<p>\u3068\u3001clone\u3057\u305f\u5f8c\u3001\u300cgit submodule update \u2013init\u300d\u3067chef\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u53d6\u308a\u8fbc\u307f\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u3001\u300cgit submodule foreach &#8216;git pull origin master&#8217;\u300d\u3067submodule\u3092\u6700\u65b0\u5316\u3057\u307e\u3059\u3002<br \/>\n\uff08<a href=\"http:\/\/rochefort.hatenablog.com\/entry\/20110410\/p1\">http:\/\/rochefort.hatenablog.com\/entry\/20110410\/p1<\/a>\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u3002\uff09<\/p>\n<p>\u3042\u3068\u306f\u300cvagrant up\u300d\u3059\u308b\u3060\u3051\u3002\u306e\u306f\u305a\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u3084\u308a\u65b9\u3060\u3068\u3001vagrant\u3092\u52d5\u304b\u3059\u65b9\u306ePC\u306bchef\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u306f\u306a\u3044\u306e\u3067\u697d\u3061\u3093\u3067\u3059\u3002<\/p>\n<h1>\u307e\u3068\u3081<\/h1>\n<p>\u9577\u3005\u30683\u56de\u306b\u5206\u3051\u3066\u8a18\u4e8b\u3092\u4f5c\u6210\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3067\u7d71\u4e00\u3057\u305f\u958b\u767a\u74b0\u5883\u3092\u697d\u306b\u793e\u5185\u306b\u5c55\u958b\u51fa\u6765\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p>\u96e3\u3057\u3044\u306e\u306frpm\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30ec\u30b7\u30d4\u3092\u4f5c\u6210\u3059\u308b\u90e8\u5206\u3067\u3057\u3087\u3046\u304b\u2026<br \/>\n\u4f9d\u5b58\u95a2\u4fc2\u306e\u30a8\u30e9\u30fc\u304c\u7d50\u69cb\u51fa\u3066\u304f\u308b\u306e\u3067\u3002<\/p>\n<p>\u307e\u3060\u307e\u3060Vagrant\u3082chef\u3082\u4f7f\u3044\u3053\u306a\u305b\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u52b9\u7387\u7684\u306b\u958b\u767a\u304c\u884c\u3048\u308b\u3088\u3046\u306b\u74b0\u5883\u3092\u6574\u3048\u3066\u884c\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\uff01<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u753b\u50cf\u306f\u3001\u5546\u58f2\u7e41\u76db\u306a\u98fe\u308a\u4ed8\u3051\u3092\u3059\u308b\u90e8\u9577\u3067\u3059\u3002\u4eca\u5e74\u3082\u3055\u3089\u306b\u8e8d\u9032\u3067\u304d\u308b\u4e00\u5e74\u3067\u3042\u308a\u307e\u3059\u3088\u3046\u306b\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u958b\u767a\uff12\u90e8\u306e\u5409\u5ca1\u3067\u3059\u3002 \u524d\u56de\u306e\u8a18\u4e8b rpm\u3092\u4f7f\u3063\u305fchef-solo\u306e\u30ec\u30b7\u30d4\u3092\u4f5c\u6210\u3057\u3066\u3044\u304f \u524d\u3005\u56de\u306e\u8a18\u4e8b\u3000chef-solo\u3067\u4f7f\u3046rpm\u306e\u914d\u4fe1\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3066\u3066\u307f\u308b \u4eca\u56de\u306fVagrant\u3068chef-solo\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u958b\u767a [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":624,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[13,14],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/530"}],"collection":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/comments?post=530"}],"version-history":[{"count":27,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/530\/revisions"}],"predecessor-version":[{"id":1207,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/530\/revisions\/1207"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/media\/624"}],"wp:attachment":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/media?parent=530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/categories?post=530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/tags?post=530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}