简体   繁体   中英

Chef: grafana community recipe error

I'm using the following recipe from chef supermarket: https://supermarket.chef.io/cookbooks/grafana

When I try to execute the following code it crashes:

grafana_user 'lechucico' do
  user(
    name: 'lechucico',
    email: 'lechucico@example.com',
    password: 'lechu',
    isAdmin: true,
    organizations: [
      { name: 'Administration', role: 'Admin' },
      { name: 'Marketing', role: 'Admin' }
    ]
  )
  action :create
end

This error raises:

Chef::Exceptions::ValidationFailed
==> default: ----------------------------------
==> default: Option user must be a kind of [String]!  You passed {"name"=>"lechucico", "email"=>"lechucico@example.com", "password"=>"lechu", "isAdmin"=>true, "organizations"=>[{"name"=>"Administration", "role"=>"Admin"}, {"name"=>"Marketing", "role"=>"Admin"}]}.
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default:   /var/chef/cache/cookbooks/living-grafana/recipes/default.rb:50:in `block in from_file'
==> default:   /var/chef/cache/cookbooks/living-grafana/recipes/default.rb:49:in `from_file'
==> default:
==> default: Relevant File Content:
==> default: ----------------------
==> default: /var/chef/cache/cookbooks/living-grafana/recipes/default.rb:
==> default:
==> default:  43:  #  )
==> default:  44:  #  action :update
==> default:  45:  #end
==> default:  46:
==> default:  47:  grafana_organization 'Marketing'
==> default:  48:
==> default:  49:  grafana_user 'lechucico' do
==> default:  50>>   user(
==> default:  51:      'name' => 'lechucico',
==> default:  52:      'email' => 'lechucico@example.com',
==> default:  53:      'password' => 'lechu',
==> default:  54:      'isAdmin' => true,
==> default:  55:      'organizations' => [
==> default:  56:        { 'name' =>  'Administration', 'role' =>  'Admin' },
==> default:  57:        { 'name' =>  'Marketing', 'role' =>  'Admin' }
==> default:  58:      ]
==> default:  59:    )
==> default:
==> default: Platform:
==> default: ---------
==> default: x86_64-linux

Why this isn't working?

Some links with information:

https://github.com/JonathanTron/chef-grafana

https://github.com/JonathanTron/chef-grafana/pull/136

That's due to the fact that despite the pull request has been merged into master, there was no release of the code within master to supermarket.

According to the comments on this issue the ownership of the cookbook is likely to move to the sous-chef group.

If you rely on this latest code, you should download it from git, change its version and push to your chef-server.

You may wish to join Slack #sous-chefs channel on http://community-slack.chef.io/ for more information on the takeover process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM