簡體   English   中英

廚師Mysql食譜失敗

[英]Chef Mysql recipe fails

我在Centos7上使用最新的Chef'MYSQL'食譜,要求具有類似這樣的標准角色

name "lamp"
description "A full lamp server"
run_list "recipe[apache2]", 
         "recipe[apache2::mod_php5]",
         "recipe[apache2::logrotate]",
         "recipe[yum]",
         "recipe[yum-epel]",
         "recipe[mysql::client]",
         "recipe[mysql::server]"
override_attributes({
  "starter_name" => "Jonathan Tizard",
    "mysql" => {
        "server_root_password" => 'iloverandompasswordsbutthiswilldo',
        "server_repl_password" => 'iloverandompasswordsbutthiswilldo',
        "server_debian_password" => 'iloverandompasswordsbutthiswilldo'
    }
})

但是我收到以下錯誤,我是否在這里遺漏了一些明顯的東西? 我不知道為什么它失敗了。 我以為我沒有定義變量或其他東西?

Recipe: mysql::server
  * mysql_service[default] action create
  Recipe: yum-mysql-community::mysql55
    * yum_repository[mysql55-community] action create
      * template[/etc/yum.repos.d/mysql55-community.repo] action create (up to date)
      * execute[yum-makecache-mysql55-community] action nothing (skipped due to action :nothing)
      * ruby_block[yum-cache-reload-mysql55-community] action nothing (skipped due to action :nothing)
       (up to date)
    - evaluate block and run any associated actions
    ================================================================================
    Error executing action `create` on resource 'mysql_service[default]'
    ================================================================================

    ArgumentError
    -------------
    You must supply a name when declaring a package resource

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_rhel.rb:168:in `block (2 levels) in <class:Rhel>'
    /var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_rhel.rb:153:in `block in <class:Rhel>'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/mysql/recipes/server.rb

     20: mysql_service node['mysql']['service_name'] do
     21:   version node['mysql']['version']
     22:   port node['mysql']['port']
     23:   data_dir node['mysql']['data_dir']
     24:   server_root_password node['mysql']['server_root_password']
     25:   server_debian_password node['mysql']['server_debian_password']
     26:   server_repl_password node['mysql']['server_repl_password']
     27:   allow_remote_root node['mysql']['allow_remote_root']
     28:   remove_anonymous_users node['mysql']['remove_anonymous_users']
     29:   remove_test_database node['mysql']['remove_test_database']
     30:   root_network_acl node['mysql']['root_network_acl']
     31:   version node['mysql']['version']
     32:   action :create
     33: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/mysql/recipes/server.rb:20:in `from_file'

    mysql_service("default") do
      action [:create]
      retries 0
      retry_delay 2
      guard_interpreter :default
      service_name "default"
      version "5.5"
      package_name "mysql55-server"
      data_dir "/var/lib/mysql"
      port "3306"
      remove_anonymous_users true
      remove_test_database true
      server_root_password "iloverandompasswordsbutthiswilldo"
      server_debian_password "iloverandompasswordsbutthiswilldo"
      server_repl_password "iloverandompasswordsbutthiswilldo"
      cookbook_name "mysql"
      recipe_name "server"
    end


Running handlers:
[2014-08-29T21:54:45+00:00] ERROR: Running exception handlers
Running handlers complete
[2014-08-29T21:54:45+00:00] ERROR: Exception handlers complete
[2014-08-29T21:54:45+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 1 resources updated in 9.218038398 seconds
[2014-08-29T21:54:46+00:00] ERROR: mysql_service[default] (mysql::server line 20) had an error: ArgumentError: You must supply a name when declaring a package resource
[2014-08-29T21:54:47+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

看到這個

菜譜定義了應該安裝的軟件包,並在OS版本上選擇了“如果/然后”選項。

我認為centos 7版本解析會引起錯誤。 也許您可以檢查節點的platform_version值,以找出為什么它不能確定正確的程序包。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM