Created
May 25, 2012 16:20
-
-
Save mrnugget/2789002 to your computer and use it in GitHub Desktop.
Chef can't find solo.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "app": { | |
| "root_path": "/vagrant" | |
| }, | |
| "mysql": { | |
| "server_root_password": "password" | |
| }, | |
| "run_list": ["recipe[main]"] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root = File.absolute_path(File.dirname(__FILE__)) | |
| file_cache_path root | |
| cookbook_path root + '/cookbooks' | |
| log_level :info | |
| log_location STDOUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Files in current directory `~/chef`: | |
| vagrant@precise64:~/chef$ ls | |
| bootstrap.sh chef-stacktrace.out config cookbooks deploy.sh MONITRC node.json solo.rb Vagrantfile | |
| # Running chef-solo with `-c solo.rb` | |
| # It doesn't complain about a missing `solo.rb` here. | |
| vagrant@precise64:~/chef$ sudo chef-solo -c solo.rb | |
| [Fri, 25 May 2012 16:16:37 +0000] INFO: *** Chef 0.10.10 *** | |
| [Fri, 25 May 2012 16:16:37 +0000] INFO: Run List is [] | |
| [Fri, 25 May 2012 16:16:37 +0000] INFO: Run List expands to [] | |
| [Fri, 25 May 2012 16:16:37 +0000] INFO: Starting Chef Run for precise64 | |
| [Fri, 25 May 2012 16:16:37 +0000] INFO: Running start handlers | |
| [Fri, 25 May 2012 16:16:37 +0000] INFO: Start handlers complete. | |
| [Fri, 25 May 2012 16:16:38 +0000] INFO: Chef Run complete in 0.029810948 seconds | |
| [Fri, 25 May 2012 16:16:38 +0000] INFO: Running report handlers | |
| [Fri, 25 May 2012 16:16:38 +0000] INFO: Report handlers complete | |
| # Running chef-solo with `-c solo.rb -j node.json` | |
| # `node.json` contains the run_list | |
| # It should now provision the server | |
| vagrant@precise64:~/chef$ sudo chef-solo -c solo.rb -j node.json | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: *** Chef 0.10.10 *** | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: Setting the run_list to ["recipe[main]"] from JSON | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: Run List is [recipe[main]] | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: Run List expands to [main] | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: Starting Chef Run for precise64 | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: Running start handlers | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: Start handlers complete. | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: ohai plugins will be at: /etc/chef/ohai_plugins | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: Processing remote_directory[/etc/chef/ohai_plugins] action create (ohai::default line 23) | |
| [Fri, 25 May 2012 16:16:42 +0000] INFO: Processing cookbook_file[/etc/chef/ohai_plugins/README] action create (dynamically defined) | |
| [Fri, 25 May 2012 16:16:42 +0000] ERROR: Running exception handlers | |
| [Fri, 25 May 2012 16:16:42 +0000] ERROR: Exception handlers complete | |
| [Fri, 25 May 2012 16:16:42 +0000] FATAL: Stacktrace dumped to /home/vagrant/chef/chef-stacktrace.out | |
| [Fri, 25 May 2012 16:16:42 +0000] FATAL: Errno::ENOENT: No such file or directory - solo.rb | |
| # Running chef only with `-j node.json` | |
| # Now it complains about a missing `solo.rb` | |
| vagrant@precise64:~/chef$ sudo chef-solo -j node.json | |
| [Fri, 25 May 2012 16:17:09 +0000] WARN: ***************************************** | |
| [Fri, 25 May 2012 16:17:09 +0000] WARN: Did not find config file: /etc/chef/solo.rb, using command line options. | |
| [Fri, 25 May 2012 16:17:09 +0000] WARN: ***************************************** | |
| [Fri, 25 May 2012 16:17:09 +0000] INFO: *** Chef 0.10.10 *** | |
| [Fri, 25 May 2012 16:17:09 +0000] INFO: Setting the run_list to ["recipe[main]"] from JSON | |
| [Fri, 25 May 2012 16:17:09 +0000] INFO: Run List is [recipe[main]] | |
| [Fri, 25 May 2012 16:17:09 +0000] INFO: Run List expands to [main] | |
| [Fri, 25 May 2012 16:17:09 +0000] INFO: Starting Chef Run for precise64 | |
| [Fri, 25 May 2012 16:17:09 +0000] INFO: Running start handlers | |
| [Fri, 25 May 2012 16:17:09 +0000] INFO: Start handlers complete. | |
| [Fri, 25 May 2012 16:17:09 +0000] ERROR: Running exception handlers | |
| [Fri, 25 May 2012 16:17:09 +0000] ERROR: Exception handlers complete | |
| [Fri, 25 May 2012 16:17:09 +0000] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out | |
| [Fri, 25 May 2012 16:17:09 +0000] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook main not found. If you're loading main from another cookbook, make sure you configure the dependency in your metadata | |
| # Why doesn't chef complain when running without `-j node.json`? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran into this same issue. Chef doesn't seem to complain if the paths in the command line options are full paths. For some reason, it doesn't like relative paths at the end. It seems like a bug.