{"id":7382,"date":"2015-03-04T11:30:23","date_gmt":"2015-03-04T02:30:23","guid":{"rendered":"http:\/\/www.creationline.com\/?p=7382"},"modified":"2015-03-12T12:53:27","modified_gmt":"2015-03-12T03:53:27","slug":"%e5%92%8c%e8%a8%b3-chef-12%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bresource%e3%81%a8provider%e3%81%ae%e5%8b%95%e7%9a%84%e8%a7%a3%e6%b1%ba-getchef","status":"publish","type":"post","link":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/7382","title":{"rendered":"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef"},"content":{"rendered":"<p>\u672c\u7a3f\u306f <a href=\"https:\/\/www.chef.io\/blog\/2015\/02\/10\/chef-12-provider-resolver\/\">Chef-12 Dynamic Resource and Provider Resolution<\/a> (2015\/02\/10) \u306e\u548c\u8a33\u3067\u3059\u3002<\/p>\n<h2>\u80cc\u666f<\/h2>\n<p>Chef 12\u3067\u306f\u3001'lib\/chef\/platform\/provider_mapping.rb'\u306b\u3042\u3063\u305f\u53e4\u3044Chef::Platform\u306e\u30cf\u30c3\u30b7\u30e5\u30de\u30c3\u30d7\u306f\u975e\u63a8\u5968\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001Provider\u3068Resolver\u306e\u52d5\u7684\u89e3\u6c7a\u306e\u6a5f\u69cb\u304c\u63a8\u5968\u3055\u308c\u3001Resource\u3068Provider\u306eDSL\u30e1\u30bd\u30c3\u30c9\u3092\u901a\u3057\u3066\u64cd\u4f5c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002Chef 11\u3067\u306f\u3001\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u305f\u3081\u306e\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306e\u5171\u901a\u4e8b\u9805\u3068\u3057\u3066\u3001Chef::Platform\u30cf\u30c3\u30b7\u30e5\u30de\u30c3\u30d7\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nclass Chef<br \/>\n  class Platform<\/p>\n<p>    class << self\n      attr_writer :platforms\n \n      def platforms\n        @platforms ||= begin\n          require 'chef\/providers'\n \n          {\n            :mac_os_x => {<br \/>\n              :default => {<br \/>\n                :package => Chef::Provider::Package::Macports,<br \/>\n                :service => Chef::Provider::Service::Macosx,<br \/>\n                :user => Chef::Provider::User::Dscl,<br \/>\n                :group => Chef::Provider::Group::Dscl<br \/>\n              }<br \/>\n            },<br \/>\n            :mac_os_x_server => {<br \/>\n              :default => {<br \/>\n                :package => Chef::Provider::Package::Macports,<br \/>\n                :service => Chef::Provider::Service::Macosx,<br \/>\n                :user => Chef::Provider::User::Dscl,<br \/>\n                :group => Chef::Provider::Group::Dscl<br \/>\n              }<br \/>\n            },<br \/>\n            :freebsd => {<br \/>\n              :default => {<br \/>\n                :group   => Chef::Provider::Group::Pw,<br \/>\n                :service => Chef::Provider::Service::Freebsd,<br \/>\n                :user    => Chef::Provider::User::Pw,<br \/>\n                :cron    => Chef::Provider::Cron<br \/>\n              }<br \/>\n            },<br \/>\n            [...etc for 400 lines...]<br \/>\n          }<br \/>\n        end<br \/>\n      end<br \/>\n[...etc...]<br \/>\n<\/code><\/p>\n<h2>\u65b0\u3057\u3044\u66f8\u5f0f\u306e\u4f8b<\/h2>\n<p>Chef 12\u3067\u306f\u3001Provider\u3068Resource\u306e\u30af\u30e9\u30b9\u3067'provides'\u30e1\u30bd\u30c3\u30c9\u3092\u901a\u3057\u3066\u3001Provider\u3068Resolver\u3092\u7d50\u3073\u3064\u3051\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002\u3044\u304f\u3064\u304b\u4f8b\u3092\u4e0a\u3052\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>\u3059\u3079\u3066\u306e\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306bResource\u3092\u7d50\u3073\u3064\u3051\u308b<\/h3>\n<p>\u30e6\u30fc\u30b6\u304cRecipe\u306b'cookbook_file'\u3068\u66f8\u3044\u305f\u3089\u3001\u3059\u3079\u3066\u306e\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u304c\u540c\u3058cookbook_file Resource\u3092\u5f97\u308b\u3068\u3044\u3046\u6700\u3082\u5e73\u51e1\u306a\u4f8b\u3067\u3059\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nclass Chef<br \/>\n  class Resource<br \/>\n    class CookbookFile < Chef::Resource::File\n      provides :cookbook_file\n      [...etc...]\n    end\n  end\nend\n<\/code><\/p>\n<h3>\u3042\u308bOS\u306bResource\u3092\u7d50\u3073\u3064\u3051\u308b<\/h3>\n<p>node['os'] Attribute\u304c'solaris2'\u306a\u3089\u3070\u3001ips_package Resource\u306e\u307f\u306b\u7d50\u3073\u3064\u3051\u308b\u4f8b\u3067\u3059\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nclass Chef<br \/>\n  class Resource<br \/>\n    class IpsPackage < ::Chef::Resource::Package\n \n      provides :ips_package, os: \"solaris2\"\n    end\n  end\nend\n<\/code><\/p>\n<h3>\u8907\u6570\u306eplatform_family\u306bResource\u3092\u7d50\u3073\u3064\u3051\u308b<\/h3>\n<p>\u3088\u308a\u8907\u96d1\u306a\u4f8b\u3068\u3057\u3066\u3001provides\u884c\u304cnode['platform_family']\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3001\u5024\u306e\u914d\u5217\u304c\u7528\u3044\u3089\u308c\u3066\u3044\u308b\u3082\u306e\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u3069\u306e\u3088\u3046\u306a\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306eRecipe\u306b'yum_package'\u306b\u66f8\u3044\u305f\u3068\u3057\u3066\u3082yum_package Resource\u306b\u7d50\u3073\u3064\u3051\u3089\u308c\u308b (Solaris\u3067Recipe\u306b'yum_package'\u306b\u66f8\u3044\u305f\u3068\u3057\u3066\u3082\u3001\u305d\u306e\u7a2e\u985e\u306eResource\u3092\u5f97\u3089\u308c\u308b) \u3060\u3051\u3067\u306a\u304f\u3001Red Hat\u7cfb\u306eplatform_family\u3067\u30e6\u30fc\u30b6\u304c'package'\u3068\u66f8\u3044\u305f\u3068\u3057\u3066\u3082'yum_package' Resource\u306b\u7d50\u3073\u3064\u3051\u3089\u308c\u3066\u89e3\u6c7a\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u3001Red Hat\u3067'package \"foo\"'\u3068\u66f8\u3044\u305f\u3089\u3001\u7d20\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u691c\u8a3c\u3092\u884c\u3063\u3066\u3042\u3089\u3086\u308byum\u7279\u6709\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u62d2\u5426\u3059\u308b\u3088\u3046\u306a\u7d20\u306eChef::Resource::Package\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5f97\u308b\u3068\u3044\u3046\u3001Chef 11\u304b\u3089\u306e\u3061\u3087\u3063\u3068\u3057\u305f\u5909\u66f4\u3067\u3059\u3002Chef 12\u3067\u306f\u3001Red Hat\u3067\u306fYumPackage Provider\u306e\u305f\u3081\u306e\u6b63\u3057\u3044\u691c\u8a3c\u3092\u884c\u3046Chef::Resource::YumPackage\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nclass Chef<br \/>\n  class Resource<br \/>\n    class YumPackage < Chef::Resource::Package\n \n      provides :yum_package\n      provides :package, os: \"linux\", platform_family: [ \"rhel\", \"fedora\" ]\n    end\n  end\nend\n<\/code><\/p>\n<h3>\u4efb\u610f\u306eNode Attribute\u306b\u57fa\u3044\u3066Resource\u3092\u7d50\u3073\u3064\u3051\u308b<\/h3>\n<p>Solaris2\u306b\u304a\u3044\u3066\u3001platform_version\u304c5.10\u4ee5\u4e0b\u306a\u3089\u3070solaris_package\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u3001platform_version\u304c5.11\u4ee5\u4e0a\u306a\u3089ips_package\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308b\u306a\u3089\u3070\u3001provides\u884c\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nclass Chef<br \/>\n  class Resource<br \/>\n    class SolarisPackage < Chef::Resource::Package\n \n      provides :solaris_package\n      provides :package, os: \"solaris2\", platform_family: \"nexentacore\"\n      provides :package, os: \"solaris2\", platform_family: \"solaris2\" do |node|\n        # on >= Solaris 11 we default to IPS packages instead<br \/>\n        node[:platform_version].to_f <= 5.10\n      end\n \n    end\n  end\nend\n<\/code><\/p>\n<h2>Resource\u3068Provider\u306eprovides\u884c<\/h2>\n<p>Resource\u30d5\u30a1\u30a4\u30eb\u306e\u3059\u3079\u3066\u306eprovides\u884c\u306b\u3064\u3044\u3066\u3001\u901a\u5e38\u306fProvider\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u5bfe\u5fdc\u3059\u308bprovides\u884c\u3067\u3042\u308b\u3079\u304d\u3067\u3059\u3002Resource\u306f\u3001Resource\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306b\u3082\u306f\u3084\u660e\u793a\u7684\u306bProvider\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002Resource\u3067\u306eProvider\u306e\u660e\u793a\u7684\u306a\u5b9a\u7fa9\u306f\u307e\u3060\u52d5\u4f5c\u3057\u307e\u3059\u304c\u3001Provider\u306e\u52d5\u7684\u89e3\u6c7a\u3067\u306f\u3053\u308c\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002Provider\u30d5\u30a1\u30a4\u30eb\u3067\u306eprovides\u884c\u304c\u306a\u304f\u3066\u3082\u4eca\u306f\u52d5\u4f5c\u3057\u3001Resource\u540d\u306b\u57fa\u304fProvider\u306e\u6c7a\u5b9a\u3092\u58ca\u3057\u305f\u308a\u306f\u3057\u307e\u305b\u3093\u304c\u3001\u3053\u308c\u306f\u975e\u63a8\u5968\u3068\u306a\u308a\u307e\u3059\u3002\u8fd1\u3044\u3046\u3061\u306bChef\u306f\u8b66\u544a\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u3044\u305a\u308cResource\u3068Provider\u306e\u4e21\u65b9\u3067provides\u884c\u304c\u4e00\u81f4\u3057\u306a\u3051\u308c\u3070\u5931\u6557\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30b5\u30dd\u30fc\u30c8\u3059\u308bprovides\u306e\u66f8\u5f0f<\/h2>\n<p>provides\u884c\u306f\u3001\u914d\u5217\u304b\u6587\u5b57\u5217\u306e\u3069\u3061\u3089\u304b\u306b\u4e00\u81f4\u3059\u308b'os'\u3001'platform'\u3001'platform_family'\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6301\u3061\u307e\u3059\u3002\u307e\u305f\u3001Node Object\u306b\u6e21\u3055\u308c\u3066\u3001Node\u306b\u7d50\u3073\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u3089\u771f\u3092\u8fd4\u3059\u3053\u3068\u3092\u671f\u5f85\u3055\u308c\u308b\u30d6\u30ed\u30c3\u30af\u3082\u6301\u3061\u307e\u3059\u3002\u8907\u6570\u306e\u30de\u30c3\u30c1\u30e3\u304c\u3042\u308b\u5834\u5408\u3001\u6761\u4ef6\u304c\u3059\u3079\u3066\u771f\u3067\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002\u8907\u6570\u306eprovides\u884c\u306f\u8907\u6570\u306e\u6761\u4ef6\u306b\u7528\u3044\u3089\u308c\u3001\u914d\u5217\u306e\u66f8\u5f0f\u306f\u914d\u5217\u306e\u8981\u7d20\u306e\u3044\u305a\u308c\u304b\u306b\u3082\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"ruby\"><br \/>\nprovides :cookbook_file<br \/>\nprovides :package, os: \"windows\"<br \/>\nprovides :rpm_package, os: [ \"linux\", \"aix\" ]<br \/>\nprovides :package, os: \"solaris2\", platform_family: \"smartos\"<br \/>\nprovides :package, platform: \"freebsd\"<br \/>\nprovides :package, os: \"linux\", platform_family: [ \"rhel\", \"fedora\" ]<br \/>\nprovides :package, os: \"solaris2\", platform_family: \"solaris2\" do |node|<br \/>\n  node[:platform_version].to_f <= 5.10\nend\n<\/code><\/p>\n<p>\u3053\u306e\u66f8\u5f0f\u306e\u5b9f\u88c5\u306flib\/chef\/node_map.rb\u30d5\u30a1\u30a4\u30eb\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002Chef::NodeMap\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306fNode Object\u306b\u57fa\u3044\u305f\u6761\u4ef6\u3092\u633f\u5165\u3055\u308c\u3046\u308b\u5024\u3092\u6301\u3064\u30ad\u30fc\u30d0\u30ea\u30e5\u30fc\u30b9\u30c8\u30a2\u3067\u3059(\u305d\u3057\u3066\u3001Node Object\u304c\u30de\u30c3\u30c1\u3059\u308b\u3068\u304d\u306e\u307f\u305d\u308c\u3089\u306f\u56de\u53ce\u3055\u308c\u307e\u3059)\u3002<\/p>\n<h2>Provider\u306e\u52d5\u7684\u89e3\u6c7a<\/h2>\n<p>Provider\u3082\u52d5\u7684\u89e3\u6c7a\u3092\u884c\u3044\u307e\u3059\u3002\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u304c\u4e0e\u3048\u3089\u308c\u305fProvider\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b(\u4f8b:init\u30b7\u30b9\u30c6\u30e0\u304csystemd\u304b\u3069\u3046\u304b\uff1f)\u3001Provider\u306eprovides?\u304c\u4e0e\u3048\u3089\u308c\u305fResource\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b(\u4f8b:service 'foo'\u306fsysvinit\u30b9\u30af\u30ea\u30d7\u30c8\u304bupstart\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\uff1f)\u3092\u6c7a\u5b9a\u3059\u308b\u305f\u3081\u306e\u3001Chef::Provider.provides? \u30e1\u30bd\u30c3\u30c9\u3068Chef::Provider.supports? \u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3059\u308b\u3001\u4e0a\u66f8\u304d\u53ef\u80fd\u306a\u8ffd\u52a0\u30e1\u30bd\u30c3\u30c9\u3092\u6301\u3061\u307e\u3059\u3002\u3053\u308c\u306fLinux\u306einit script\u30b7\u30b9\u30c6\u30e0\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u52d5\u7684\u306b\u53d6\u308a\u6271\u3046\u305f\u3081\u306b\u304a\u304a\u3088\u305d\u8a2d\u8a08\u3055\u308c\u305f\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u8a73\u7d30\u306f\u672c\u7a3f\u3067\u53d6\u308a\u6271\u3046\u7bc4\u56f2\u3092\u8d8a\u3048\u3066\u3044\u308b\u306e\u3067\u3001\u8208\u5473\u306e\u3042\u308b\u65b9\u306fservice Provider\u3092\u898b\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>LWRP\u306e\u53d6\u308a\u6271\u3044<\/h2>\n<p>LWRP\u3092\u4efb\u610f\u306e\u540d\u524d\u306b\u7d50\u3073\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\uff01 \u3082\u306f\u3084\u30c7\u30d5\u30a9\u30eb\u30c8\u306e'[cookbook_name]_[provider_filename]'\u306b\u3068\u3089\u308f\u308c\u305a\u3001\u3082\u3057\u671b\u3080\u306a\u3089\u72ec\u81ea\u306eLWRP\u3092package Provider\u306b\u7d50\u3073\u3064\u3051\u308b\u3053\u3068\u3055\u3048\u3067\u304d\u307e\u3059 (\u305f\u3068\u3048\u305d\u308c\u304c\u30c9\u30e9\u30b4\u30f3\u3060\u3068\u3057\u3066\u3082----\u3042\u308b\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u7528\u306epackage Provider\u3092Chef\u672c\u4f53\u306b\u5b9f\u88c5\u3057\u3001\u72ec\u81ea\u306epackage Provider\u304c\u65b0\u3057\u3044Chef\u672c\u4f53\u306e\u3082\u306e\u3068\u885d\u7a81\u3059\u308b\u3068\u3044\u3046\u3001API\u306e\u7834\u58ca\u7684\u306a\u5909\u66f4\u3067\u306f\u306a\u304f\u3001API\u62e1\u5f35\u3068\u3044\u3046\u30de\u30a4\u30ca\u30fc\u30ea\u30ea\u30fc\u30b9\u3067\u58ca\u3055\u308c\u308b\u3088\u3046\u306a\u5834\u5408\u3092\u8003\u3048\u3066\u307f\u3066\u304f\u3060\u3055\u3044)\u3002\u6b21\u306f\u7c21\u5358\u306a\u4f8b\u3067\u3059\u3002<\/p>\n<h4>resources\/default.rb<\/h4>\n<p><code lang=\"ruby\"><br \/>\nactions :run<br \/>\ndefault_action :run<\/p>\n<p>provides :foo_bar<\/p>\n<p>attribute :thing, kind_of: String, name_attribute: true<br \/>\n<\/code><\/p>\n<h4>providers\/default.rb<\/h4>\n<p><code lang=\"ruby\"><br \/>\nuse_inline_resources<\/p>\n<p>provides :foo_bar<\/p>\n<p>action :run do<br \/>\n  Chef::Log.warn new_resource.thing<br \/>\nend<br \/>\n<\/code><\/p>\n<h4>recipes\/default.rb<\/h4>\n<p><code lang=\"ruby\"><br \/>\nfoo_bar \"baz\"<br \/>\n<\/code><\/p>\n<h2>LWRP Chef 11 \u5f8c\u65b9\u4e92\u63db\u6027<\/h2>\n<p>Chef 11\u306fResource\u306b\u304a\u3051\u308b'provides'\u306e\u66f8\u5f0f\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u30b3\u30df\u30e5\u30cb\u30c6\u30a3Cookbook\u3084Chef 11\u5f8c\u65b9\u4e92\u63db\u6027\u304c\u4f9d\u7136\u3068\u3057\u3066\u91cd\u8981\u306a\u5834\u6240\u3067\u7528\u3044\u3089\u308c\u308b\u6a5f\u80fd\u3068\u306a\u308b\u3067\u3057\u3087\u3046\u3002Chef 12\u306fResource\u306e\u305f\u3081\u306b\u65e2\u306b\u5b58\u5728\u3057\u3066\u3044\u305fAPI\u3092\u6539\u5584\u3057\u305f\u3060\u3051\u3067\u3059\u3002Provider\u3067\u306e'provides'\u306e\u66f8\u5f0f\u3092\u8a31\u53ef\u305b\u305a\u3001\"on_platform:\"\u5f15\u6570\u3092\u53d6\u308b\u3060\u3051\u3067\u3059 (Chef 12\u306f\u5f8c\u65b9\u4e92\u63db\u306e\u305f\u3081\u306b\"on_platform\"\u3092\"platform\"\u306e\u5225\u540d\u3068\u3057\u3066\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059)\u3002LWRP\u3092\u6539\u540d\u3057Chef 11\u5f8c\u65b9\u4e92\u63db\u6027\u3092\u7dad\u6301\u3059\u308b\u3053\u3068\u306f\u3001\u5358\u7d14\u306bProvider\u304b\u3089'provides'\u884c\u3092\u524a\u9664\u3059\u308b\u304b\u3001\u7406\u60f3\u7684\u306b\u306f'if respond_to?(:provides)'\u3068\u3044\u3046\u5224\u5b9a\u3092\u7528\u3044\u3066\u4fdd\u8b77\u3057\u307e\u3059\u3002<\/p>\n<h2>\u72b6\u6cc1<\/h2>\n<p>\u52d5\u7684\u306aProvider\u3068Resolver\u306e\u6a5f\u80fd\u306f\u4f9d\u7136\u3068\u3057\u3066\u958b\u767a\u4e2d\u3067\u3001Chef 12\u3067\u306f\u5b8c\u6210\u3057\u3066\u3044\u307e\u305b\u3093\u3002Chef::Platform platform_map\u306b\u306f\u52d5\u7684\u89e3\u6c7a\u306b\u5909\u63db\u3057\u3066\u7a7a\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u30a8\u30f3\u30c8\u30ea\u304c\u307e\u3060\u6b8b\u3063\u3066\u3044\u307e\u3059\u3002\u3044\u305a\u308c\u306b\u3057\u308d\u30cf\u30c3\u30b7\u30e5\u30c6\u30fc\u30d6\u30eb\u306f\u5b8c\u5168\u306b\u524a\u9664\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nResource\u3068Provider\u306e\u4e21\u65b9\u3067\u8d77\u304d\u3066\u3044\u308b\u540d\u524d\u304b\u3089\u30af\u30e9\u30b9\u3078\u5909\u63db\u3059\u308b\u8b0e\u306e\u9b54\u6cd5\u306f\u524a\u9664\u3055\u308c\u307e\u3059\u3002\u5b9f\u969b\u306b\u7528\u3044\u3089\u308c\u308binit\u30b7\u30b9\u30c6\u30e0\u306b\u57fa\u3044\u3066\u6319\u52d5\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308bCookbook\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u305f\u3081\u306e\u52a9\u3051\u3068\u306a\u308bDSL\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u63d0\u4f9b\u3055\u308c\u308b\u5fc5\u8981\u304c\u3042\u308b\u3001\u30db\u30b9\u30c8\u3067\u4f7f\u308f\u308c\u3066\u3044\u308binit\u30b7\u30b9\u30c6\u30e0\u3092\u6c7a\u5b9a\u3059\u308b\u305f\u3081\u306e\u6709\u7528\u306a\u30d8\u30eb\u30d1\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306eAPI\u306b\u3064\u3044\u3066\u306e\u6587\u7ae0\u306f docs.chef.io \u306b\u306f\u73fe\u6642\u70b9\u3067\u306f\u5b58\u5728\u3057\u3066\u3044\u307e\u305b\u3093(\u3082\u3057\u3053\u308c\u3092\u8aad\u3093\u3067\u3044\u308b\u306e\u304cJames Scott\u306a\u3089\u3001\u4fee\u6b63\u306e\u305f\u3081\u306e\u9023\u7d61\u3092\u304f\u3060\u3055\u3044)\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7a3f\u306f Chef-12 Dynamic Resource and Provider Resolution (2015\/02\/10) \u306e\u548c\u8a33\u3067\u3059\u3002 \u80cc\u666f Chef 12\u3067\u306f\u3001&#8217;lib\/chef\/platform\/provi [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[36],"tags":[],"class_list":["post-7382","post","type-post","status-publish","format-standard","hentry","category-chef"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3<\/title>\n<meta name=\"description\" content=\"Chef |\u672c\u7a3f\u306f Chef-12 Dynamic Resource and Provider Resolution (2015\/02\/10) \u306e\u548c\u8a33\u3067\u3059\u3002 \u80cc\u666f\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.creationline.com\/tech-blog\/7382\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"og:description\" content=\"Chef |\u672c\u7a3f\u306f Chef-12 Dynamic Resource and Provider Resolution (2015\/02\/10) \u306e\u548c\u8a33\u3067\u3059\u3002 \u80cc\u666f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.creationline.com\/tech-blog\/7382\" \/>\n<meta property=\"og:site_name\" content=\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/creationline\" \/>\n<meta property=\"article:published_time\" content=\"2015-03-04T02:30:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-03-12T03:53:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/01\/screenshot.png\" \/>\n\t<meta property=\"og:image:width\" content=\"470\" \/>\n\t<meta property=\"og:image:height\" content=\"394\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Daisuke Higuchi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@creationline\" \/>\n<meta name=\"twitter:site\" content=\"@creationline\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daisuke Higuchi\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/7382#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/7382\"},\"author\":{\"name\":\"Daisuke Higuchi\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"headline\":\"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef\",\"datePublished\":\"2015-03-04T02:30:23+00:00\",\"dateModified\":\"2015-03-12T03:53:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/7382\"},\"wordCount\":242,\"commentCount\":0,\"articleSection\":[\"Chef\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/7382#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/7382\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/7382\",\"name\":\"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\"},\"datePublished\":\"2015-03-04T02:30:23+00:00\",\"dateModified\":\"2015-03-12T03:53:27+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"description\":\"Chef |\u672c\u7a3f\u306f Chef-12 Dynamic Resource and Provider Resolution (2015\\\/02\\\/10) \u306e\u548c\u8a33\u3067\u3059\u3002 \u80cc\u666f\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/7382#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/7382\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/7382#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"HOME\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Chef\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/\",\"name\":\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"description\":\"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\",\"name\":\"Daisuke Higuchi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/pngout-25-230x230.png\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/pngout-25-230x230.png\",\"contentUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/pngout-25-230x230.png\",\"caption\":\"Daisuke Higuchi\"},\"description\":\"\u306f\u3084\u308a\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"Chef |\u672c\u7a3f\u306f Chef-12 Dynamic Resource and Provider Resolution (2015\/02\/10) \u306e\u548c\u8a33\u3067\u3059\u3002 \u80cc\u666f","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.creationline.com\/tech-blog\/7382","og_locale":"ja_JP","og_type":"article","og_title":"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","og_description":"Chef |\u672c\u7a3f\u306f Chef-12 Dynamic Resource and Provider Resolution (2015\/02\/10) \u306e\u548c\u8a33\u3067\u3059\u3002 \u80cc\u666f","og_url":"https:\/\/www.creationline.com\/tech-blog\/7382","og_site_name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","article_publisher":"https:\/\/www.facebook.com\/creationline","article_published_time":"2015-03-04T02:30:23+00:00","article_modified_time":"2015-03-12T03:53:27+00:00","og_image":[{"width":470,"height":394,"url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/01\/screenshot.png","type":"image\/png"}],"author":"Daisuke Higuchi","twitter_card":"summary_large_image","twitter_creator":"@creationline","twitter_site":"@creationline","twitter_misc":{"\u57f7\u7b46\u8005":"Daisuke Higuchi","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.creationline.com\/tech-blog\/7382#article","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/7382"},"author":{"name":"Daisuke Higuchi","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"headline":"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef","datePublished":"2015-03-04T02:30:23+00:00","dateModified":"2015-03-12T03:53:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.creationline.com\/tech-blog\/7382"},"wordCount":242,"commentCount":0,"articleSection":["Chef"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.creationline.com\/tech-blog\/7382#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.creationline.com\/tech-blog\/7382","url":"https:\/\/www.creationline.com\/tech-blog\/7382","name":"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#website"},"datePublished":"2015-03-04T02:30:23+00:00","dateModified":"2015-03-12T03:53:27+00:00","author":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"description":"Chef |\u672c\u7a3f\u306f Chef-12 Dynamic Resource and Provider Resolution (2015\/02\/10) \u306e\u548c\u8a33\u3067\u3059\u3002 \u80cc\u666f","breadcrumb":{"@id":"https:\/\/www.creationline.com\/tech-blog\/7382#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.creationline.com\/tech-blog\/7382"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.creationline.com\/tech-blog\/7382#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"HOME","item":"https:\/\/www.creationline.com\/tech-blog"},{"@type":"ListItem","position":2,"name":"\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6","item":"https:\/\/www.creationline.com\/tech-blog\/cloudnative"},{"@type":"ListItem","position":3,"name":"Chef","item":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef"},{"@type":"ListItem","position":4,"name":"[\u548c\u8a33] Chef 12\u306b\u304a\u3051\u308bResource\u3068Provider\u306e\u52d5\u7684\u89e3\u6c7a #getchef"}]},{"@type":"WebSite","@id":"https:\/\/www.creationline.com\/tech-blog\/#website","url":"https:\/\/www.creationline.com\/tech-blog\/","name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.creationline.com\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206","name":"Daisuke Higuchi","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/05\/pngout-25-230x230.png","url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/05\/pngout-25-230x230.png","contentUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/05\/pngout-25-230x230.png","caption":"Daisuke Higuchi"},"description":"\u306f\u3084\u308a\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002","url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi"}]}},"_links":{"self":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/7382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=7382"}],"version-history":[{"count":0,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/7382\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=7382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=7382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=7382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}