代码之家  ›  专栏  ›  技术社区  ›  laimison

厨师“打包”资源作为LWRP

  •  -1
  • laimison  · 技术社区  · 10 年前

    我想扩展“package”资源,并将其作为LWRP-cookbookname_package提供,以便从其他食谱中调用。

    是否需要手动重写 package resource cookbookname/resources/package.rb ?

    有没有一种方法可以简单地从Chef源代码中获取现有的代码,或者有没有唯一的方法可以作为翻译人员来维护所有这些代码?

      allow_downgrade            TrueClass, FalseClass # Yum, RPM packages only
      arch                       String, Array # Yum packages only
      default_release            String # Apt packages only
      flush_cache                Array
      gem_binary                 String
      homebrew_user              String, Integer # Homebrew packages only
      notifies                   # see description
      options                    String
      package_name               String, Array # defaults to 'name' if not specified
      provider                   Chef::Provider::Package
      response_file              String # Apt packages only
      response_file_variables    Hash # Apt packages only
      source                     String
      subscribes                 # see description
      timeout                    String, Integer
      version                    String, Array
      action                     Symbol # defaults to :install if not specified
    
    1 回复  |  直到 10 年前
        1
  •  1
  •   coderanger    10 年前

    不,LWRP DSL不允许子类化。你需要把文件放在下面 libraries/ 并编写简单的旧Ruby代码。

    推荐文章