現在、仮想サーバー構築をVagrant/Chefを駆使して行っています。
site-cookbooksの中に、オペレータユーザーを作るカスタムレシピを作成中なのですが、
下記のようなエラーが発生し、成功時に出る、INFO: user[ops] createdというメッセージが見当たりません。
==> default: Running provisioner: chef_solo... ==> default: Detected Chef (latest) is already installed ==> default: Generating chef JSON and uploading... ==> default: Running chef-solo... ==> default: stdin: is not a tty ==> default: [2016-04-17T10:52:01+00:00] INFO: Forking chef instance to converge... ==> default: Starting Chef Client, version 12.10.5 ==> default: [2016-04-17T10:52:01+00:00] INFO: *** Chef 12.10.5 *** ==> default: [2016-04-17T10:52:01+00:00] INFO: Platform: x86_64-linux ==> default: [2016-04-17T10:52:01+00:00] INFO: Chef-client pid: 1433 ==> default: [2016-04-17T10:52:03+00:00] INFO: Setting the run_list to ["recipe[build-essential]", "recipe[git]", "recipe[memcached]", "recipe[nodejs]", "recipe[database]", "recipe[xml]", "recipe[ruby_build]", "recipe[rbenv::system]", "recipe[nginx]", "recipe[imagemagick]", "recipe[rails_book_cookbook::ops_user]"] from CLI options ==> default: [2016-04-17T10:52:03+00:00] INFO: Run List is [recipe[build-essential], recipe[git], recipe[memcached], recipe[nodejs], recipe[database], recipe[xml], recipe[ruby_build], recipe[rbenv::system], recipe[nginx], recipe[imagemagick], recipe[rails_book_cookbook::ops_user]] ==> default: [2016-04-17T10:52:03+00:00] INFO: Run List expands to [build-essential, git, memcached, nodejs, database, xml, ruby_build, rbenv::system, nginx, imagemagick, rails_book_cookbook::ops_user] ==> default: [2016-04-17T10:52:03+00:00] INFO: Starting Chef Run for vagrant-f6bd31b6 ==> default: [2016-04-17T10:52:03+00:00] INFO: Running start handlers ==> default: [2016-04-17T10:52:03+00:00] INFO: Start handlers complete. ==> default: Installing Cookbook Gems: ==> default: Compiling Cookbooks... ==> default: [2016-04-17T10:52:05+00:00] WARN: Chef::Provider::AptRepository already exists! Cannot create deprecation class for LWRP provider apt_repository from cookbook apt ==> default: [2016-04-17T10:52:05+00:00] WARN: AptRepository already exists! Deprecation class overwrites Custom resource apt_repository from cookbook apt ==> default: ==> default: ================================================================================ ==> default: Recipe Compile Error ==> default: ================================================================================ ==> default: ==> default: ==> default: Chef::Exceptions::RecipeNotFound ==> default: -------------------------------- ==> default: could not find recipe default for cookbook database ==> default: ==> default: ==> default: Platform: ==> default: --------- ==> default: x86_64-linux ==> default: ==> default: ==> default: ==> default: Running handlers: ==> default: [2016-04-17T10:52:05+00:00] ERROR: Running exception handlers ==> default: Running handlers complete ==> default: ==> default: [2016-04-17T10:52:05+00:00] ERROR: Exception handlers complete ==> default: Chef Client failed. 0 resources updated in 03 seconds ==> default: [2016-04-17T10:52:05+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out ==> default: [2016-04-17T10:52:05+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report ==> default: [2016-04-17T10:52:05+00:00] ERROR: could not find recipe default for cookbook database ==> default: [2016-04-17T10:52:05+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ops_user.rbに以下のコードを記載しています。
# # Cookbook Name:: rails_book_cookbook # Recipe:: ops_user user 'ops'
そして適用するためにVagrantfileには以下のように記述しています。
config.vm.provision :chef_solo do |chef| chef.cookbooks_path = ["./cookbooks", "./site-cookbooks"] chef.add_recipe 'build-essential' chef.add_recipe 'git' chef.add_recipe 'memcached' chef.add_recipe 'nodejs' chef.add_recipe 'database' chef.add_recipe 'xml' chef.add_recipe 'ruby_build' chef.add_recipe 'rbenv::system' chef.add_recipe 'nginx' chef.add_recipe 'imagemagick' chef.add_recipe 'rails_book_cookbook::ops_user' chef.json = { "rbenv" => { "global" => "2.1.2", "rubies" => ["2.1.2"], "gems" => { "2.1.2" => [ { 'name' => 'bundler'} ] } } } end
エラーの原因・解決策がわかるかたいらっしゃいましたらよろしくお願い致します。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。