Chef infra 使用Chef资源调配生成数字海洋机器

Chef infra 使用Chef资源调配生成数字海洋机器,chef-infra,Chef Infra,我正试图通过厨师资源调配产生数字海洋的节点。我点击了链接: 但它不工作,并给出如下错误: ================================================================================ Error executing action `converge` on resource 'machine[aaaa]' ====================================================

我正试图通过厨师资源调配产生数字海洋的节点。我点击了链接:

但它不工作,并给出如下错误:

 ================================================================================
    Error executing action `converge` on resource 'machine[aaaa]'
    ================================================================================

    ArgumentError
    -------------
    wrong number of arguments (1 for 0)

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/spawn-nodes/recipes/default.rb

     28: machine "aaaa"


    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/spawn-nodes/recipes/default.rb:28:in `from_file'

    machine("aaaa") do
      action [:converge]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      chef_server {:chef_server_url=>"https://mayank-chef-1/organizations/digitalocean", :options=>{:client_name=>"admin", :signing_key_filename=>"/root/chef-repo/.chef/admin.pem", :api_version=>"0"}}
      driver "fog:DigitalOcean"
      machine_options {:bootstrap_options=>{:image_distribution=>"Ubuntu", :image_name=>"14.04.4 x64", :flavor_name=>"2GB", :region_name=>"New York 3", :key_name=>"MayankPorwalSSHkey"}}
      declared_type :machine
      cookbook_name "spawn-nodes"
      recipe_name "default"
    end

    Platform:
    ---------
    x86_64-linux

[2016-06-17T07:12:21-04:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2016-06-17T07:12:21-04:00] ERROR: Running exception handlers
Running handlers complete
[2016-06-17T07:12:21-04:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 07 seconds
[2016-06-17T07:12:21-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-06-17T07:12:21-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-06-17T07:12:21-04:00] ERROR: machine[aaaa] (spawn-nodes::default line 28) had an error: ArgumentError: wrong number of arguments (1 for 0)
[2016-06-17T07:12:21-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
以下是我的繁殖节点配方的default.rb文件代码:

#
# Cookbook Name:: spawn-nodes
# Recipe:: default
#
# Copyright 2016, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
require "chef/provisioning"
require "chef/provisioning/fog_driver/recipe_dsl"

chef_gem "chef-provisioning-fog" do
  compile_time false
  action :install
end

with_driver "fog:DigitalOcean"

add_machine_options :bootstrap_options => {
  :image_distribution => "Ubuntu",
  :image_name => "14.04.4 x64",
  :flavor_name => "2GB",
  :region_name => "New York 3",
  :key_name => "MayankPorwalSSHkey"
}

machine "aaaa"

有人能告诉我我做错了什么吗?

今天我遇到了一些问题。它看起来像一个bug,根本不起作用。要了解核心问题是什么,您需要检查/var/chef/cache/chef-stacktrace.out。对我来说,它说(我已经通过Brew在MacBook中安装了ChefDK,所以我希望您的路径可以不同):

所以在ssh_keys.rb中,它们传递的参数是不期望的。如果打开此文件,您将找到此方法:

    def all(filters={})
      data = service.list_ssh_keys(filters)
      links = data.body["links"]
      get_paged_links(links)
      keys = data.body["ssh_keys"]
      load(keys)
    end
而service.list_ssh_密钥不需要任何参数。如果您要在此文件中进行更改并删除filters参数,则它将起作用

我认为这是一个错误。我会在有时间的时候报告

    def all(filters={})
      data = service.list_ssh_keys(filters)
      links = data.body["links"]
      get_paged_links(links)
      keys = data.body["ssh_keys"]
      load(keys)
    end