{"id":3019,"date":"2013-07-22T17:23:12","date_gmt":"2013-07-22T08:23:12","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=3019"},"modified":"2025-03-12T11:29:02","modified_gmt":"2025-03-12T02:29:02","slug":"centos6%e3%81%a7chef-solo%e3%82%929%e6%89%8b%e3%81%a7%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97%e3%81%a6%e5%ae%9f%e8%a1%8c%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2013\/07\/22\/centos6%e3%81%a7chef-solo%e3%82%929%e6%89%8b%e3%81%a7%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97%e3%81%a6%e5%ae%9f%e8%a1%8c%e3%81%99%e3%82%8b\/","title":{"rendered":"CentOS6\u3067chef-solo\u30929\u624b\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u5b9f\u884c\u3059\u308b"},"content":{"rendered":"<p>chef-solo\u3067\uff08\u4e00\u4f8b\u3068\u3057\u3066\uff09PostgreSQL\u30b5\u30fc\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u8d77\u52d5\u3059\u308b\u307e\u3067\u3002<br \/>\n\u4e0a\u624b\u3044\u4eba\u306f\u3082\u3063\u3068\u77ed\u304f\u51fa\u6765\u308b\u3093\u3060\u308d\u3046\u306a\u30fc\u3068\u601d\u3044\u3064\u3064\u3002<br \/>\n\u305d\u308c\u3068\u3001\u3042\u308f\u3088\u304f\u3070chef-server\u3092\u8ab0\u304b\u6700\u77ed\u624b\u3067\u66f8\u3044\u3066\u304f\u308c\u306a\u3044\u304b\u306a\u30fc\u3068\u601d\u3044\u3064\u3064\u3002<\/p>\n<p><!--more--><\/p>\n<p>\uff11\uff1a http:\/\/www.opscode.com\/chef\/install\/ \u304b\u3089\u81ea\u5206\u306e\u74b0\u5883\u306eRPM\u3092\u53d6\u5f97\u3059\u308b<br \/>\nChef Client > Enterprise Linux > 6 > i686 > 11.4.4-2<\/p>\n<p>\uff12\uff1a rpm\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<br \/>\n# rpm -ivh chef-11.4.4-2.el6.i686.rpm<\/p>\n<p>\uff13\uff1aknife\u306e\u8a2d\u5b9a<br \/>\n# knife configure<br \/>\n\u5168\u3066\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u307e\u307e\u30a8\u30f3\u30bf\u30fc<\/p>\n<p>\uff14\uff1a\/etc\/chef\/solo.rb\u3092\u4f5c\u6210<br \/>\n<code>file_cache_path \"\/tmp\/chef-repo\"<br \/>\ncookbook_path [\"\/hoge\/chef-repo\/cookbooks\"]<\/code><\/p>\n<p>\uff15\uff1agit\u304b\u3089\u30ec\u30dd\u30b8\u30c8\u30ea\u69cb\u6210\u3092\u30af\u30ed\u30fc\u30f3<br \/>\n# cd \/hoge<br \/>\n# git clone http:\/\/github.com\/opscode\/chef-repo.git<br \/>\n\u203b\/hoge\/\u306f\uff14\uff1a\u306esolo.rb\u3067\u6307\u5b9a\u3057\u305fcookbook_path\u306e\u5834\u6240\u3067\u3001chef-repo\u4ee5\u4e0b\u306fgit\u3067\u4f5c\u6210\u3055\u308c\u308b\u3002<\/p>\n<p>\uff16\uff1a\u30af\u30c3\u30af\u30d6\u30c3\u30af\u4f5c\u6210<br \/>\n# knife cookbook create postgres -o .\/chef-repo\/cookbooks<\/p>\n<p>\uff17\uff1a\u30ec\u30b7\u30d4\u4f5c\u6210<br \/>\n .\/chef-repo\/cookbooks\/postgres\/recipe\/default.rb \u3092\u7de8\u96c6<br \/>\n<code># yum install<br \/>\nyum_package \"postgresql-server\" do<br \/>\n action :install<br \/>\nend<br \/>\n# initdb<br \/>\nversion_file = \"\/var\/lib\/pgsql\/data\/PG_VERSION\"<br \/>\nif not File.exists? version_file then<br \/>\n execute \"postgresql-init\" do<br \/>\n command \"service postgresql initdb\"<br \/>\n end<br \/>\n sleep 5<br \/>\nend<br \/>\n# start<br \/>\nservice \"postgresql\" do<br \/>\n action [:enable, :restart]<br \/>\nend<\/code><\/p>\n<p>\uff18\uff1a\u8a2d\u5b9a\u7528JSON .\/chef-repo\/postgres.json \u3092\u4f5c\u6210<br \/>\n<code>{<br \/>\n  \"run_list\": [\"recipe[postgres]\"]<br \/>\n}<\/code><\/p>\n<p>\uff19\uff1a\u5b9f\u884c<br \/>\n# chef-solo -j .\/chef-repo\/postgres.json<\/p>\n<p>\u5f8c\u306f\u3072\u305f\u3059\u3089\uff16\uff5e\uff19\u3092\u7e70\u308a\u8fd4\u3059\u3060\u3051\u3067\u3059\u3002<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3019&#038;t=CentOS6%E3%81%A7chef-solo%E3%82%929%E6%89%8B%E3%81%A7%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3019&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=CentOS6%E3%81%A7chef-solo%E3%82%929%E6%89%8B%E3%81%A7%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3019&#038;text=CentOS6%E3%81%A7chef-solo%E3%82%929%E6%89%8B%E3%81%A7%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3019&#038;title=CentOS6%E3%81%A7chef-solo%E3%82%929%E6%89%8B%E3%81%A7%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=CentOS6%E3%81%A7chef-solo%E3%82%929%E6%89%8B%E3%81%A7%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3019\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=CentOS6%E3%81%A7chef-solo%E3%82%929%E6%89%8B%E3%81%A7%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3019\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>chef-solo\u3067\uff08\u4e00\u4f8b\u3068\u3057\u3066\uff09PostgreSQL\u30b5\u30fc\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u8d77\u52d5\u3059\u308b\u307e\u3067\u3002 \u4e0a\u624b\u3044\u4eba\u306f\u3082\u3063\u3068\u77ed\u304f\u51fa\u6765\u308b\u3093\u3060\u308d\u3046\u306a\u30fc\u3068\u601d\u3044\u3064\u3064\u3002 \u305d\u308c\u3068\u3001\u3042\u308f\u3088\u304f\u3070chef-server\u3092\u8ab0\u304b\u6700\u77ed\u624b\u3067\u66f8\u3044\u3066\u304f\u308c\u306a\u3044\u304b\u306a\u30fc [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[],"class_list":["post-3019","post","type-post","status-publish","format-standard","hentry","category-chef"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=3019"}],"version-history":[{"count":13,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3019\/revisions"}],"predecessor-version":[{"id":8220,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3019\/revisions\/8220"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=3019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=3019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=3019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}