vagrantでchef_soloでprovisionしようとした上で、vagrant provision
とかvagrant reload --provision
をしようとすると、意味不明のコケ方をする。
==> default: [2015-03-13T20:13:49+09:00] ERROR: Role Base-settings (included by 'top level') is in the runlist but does not exist. Skipping expand.
==> default:
==> default: ================================================================================
==> default: Error expanding the run_list:
==> default: ================================================================================
==> default:
とログは言っているのだが、vagrant destory
して作りなおすとうまく行く。
よく見ると
正常時
==> default: Mounting shared folders...
default: /vagrant => /Users/shn/Documents/projects/SexyProj/Vagrant
default: /tmp/vagrant-chef/8038246c2f51c3715e8e1a90fc487018/roles => /Users/shn/Documents/projects/SexyProj/chef-repo/roles
default: /tmp/vagrant-chef/bf6c80968df8f6833cb062fcce85c668/cookbooks => /Users/shn/Documents/projects/SexyProj/chef-repo/cookbooks
default: /tmp/vagrant-chef/7f1180f0b82febda17b1eeed5e0cec8b/cookbooks => /Users/shn/Documents/projects/SexyProj/chef-repo/site-cookbooks
default: /tmp/vagrant-chef/c578295aa517d0324ff62f7f507bfa6b/data_bags => /Users/shn/Documents/projects/SexyProj/chef-repo/data_bags
==> default: Running provisioner: chef_solo...
異常時
==> default: Mounting shared folders...
default: /vagrant => /Users/shn/Documents/projects/SexyProj/Vagrant
で、chef用のディレクトリがマウントできていないっぽい。
試しに、/tmp/vagrant-chefをrenameしてみると、
Shared folders that Chef requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a `vagrant reload` so that the proper shared
folders will be prepared and mounted on the VM.```
と怒られた。
解決
Google先生とStackOverflow先生によると、これはbugらしい (http://stackoverflow.com/questions/27975541/vagrant-chef-error-in-provision-shared-folders-that-chef-requires-are-missin)
rm .vagrant/machines/default/virtualbox/synced_folders
vagrant reload --provision
これで無事解決