Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting up Nginx with Vagrant and Chef
    primarykey
    data
    text
    <p>Starting over. :P @crum2 Tried the apt-get update but no luck. :\ I did although speak to my friend and he mentioned I was using a box of his that isn't the most reliable. So there's a way to save a .box? Is that after provisioning via chef etc? Need to do more reading... obviously. So I changed to the following:</p> <p>Vagrantfile</p> <pre><code> # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.network :public_network config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--memory", "1024"] end config.vm.provision :chef_solo do |chef| chef.cookbooks_path = "cookbooks" chef.add_recipe "nginx" end end </code></pre> <p>I've created my own cookbooks directory and downloaded only what I believe is needed according to: <a href="http://community.opscode.com/cookbooks/nginx" rel="nofollow">http://community.opscode.com/cookbooks/nginx</a></p> <p>Cookbooks</p> <pre><code> |__build-essential |__nginx |__ohai |__runit </code></pre> <p>Terminal Output</p> <pre><code>mac-mini:test admin$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... [default] Importing base box 'precise64'... [default] Matching MAC address for NAT networking... [default] Setting the name of the VM... [default] Clearing any previously set forwarded ports... [default] Creating shared folders metadata... [default] Clearing any previously set network interfaces... [default] Available bridged network interfaces: 1) en0: Ethernet 2) en1: Wi-Fi (AirPort) What interface should the network bridge to? 1 [default] Preparing network interfaces based on configuration... [default] Forwarding ports... [default] -- 22 =&gt; 2222 (adapter 1) [default] Running any VM customizations... [default] Booting VM... [default] Waiting for VM to boot. This can take a few minutes. [default] VM booted and ready for use! [default] Configuring and enabling network interfaces... [default] Mounting shared folders... [default] -- /vagrant [default] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks [default] Running provisioner: VagrantPlugins::Chef::Provisioner::ChefSolo... Generating chef JSON and uploading... Running chef-solo... stdin: is not a tty [2013-04-15T23:42:59+00:00] INFO: *** Chef 10.14.2 *** [2013-04-15T23:42:59+00:00] INFO: Setting the run_list to ["recipe[nginx]"] from JSON [2013-04-15T23:42:59+00:00] INFO: Run List is [recipe[nginx]] [2013-04-15T23:42:59+00:00] INFO: Run List expands to [nginx] [2013-04-15T23:42:59+00:00] INFO: Starting Chef Run for precise64 [2013-04-15T23:42:59+00:00] INFO: Running start handlers [2013-04-15T23:42:59+00:00] INFO: Start handlers complete. [2013-04-15T23:43:00+00:00] INFO: ohai plugins will be at: /etc/chef/ohai_plugins [2013-04-15T23:43:00+00:00] INFO: Processing remote_directory[/etc/chef/ohai_plugins] action create (ohai::default line 30) [2013-04-15T23:43:00+00:00] INFO: Processing directory[/etc/chef/ohai_plugins] action create (dynamically defined) [2013-04-15T23:43:00+00:00] INFO: directory[/etc/chef/ohai_plugins] created directory /etc/chef/ohai_plugins [2013-04-15T23:43:00+00:00] INFO: directory[/etc/chef/ohai_plugins] mode changed to 755 [2013-04-15T23:43:00+00:00] INFO: Processing cookbook_file[/etc/chef/ohai_plugins/README] action create (dynamically defined) [2013-04-15T23:43:00+00:00] INFO: cookbook_file[/etc/chef/ohai_plugins/README] mode changed to 644 [2013-04-15T23:43:00+00:00] INFO: cookbook_file[/etc/chef/ohai_plugins/README] created file /etc/chef/ohai_plugins/README [2013-04-15T23:43:00+00:00] INFO: remote_directory[/etc/chef/ohai_plugins] created directory /etc/chef/ohai_plugins [2013-04-15T23:43:00+00:00] INFO: remote_directory[/etc/chef/ohai_plugins] mode changed to 755 [2013-04-15T23:43:00+00:00] INFO: Processing ohai[custom_plugins] action reload (ohai::default line 44) [2013-04-15T23:43:00+00:00] INFO: ohai[custom_plugins] reloaded [2013-04-15T23:43:00+00:00] INFO: Processing ohai[reload_nginx] action nothing (nginx::ohai_plugin line 22) [2013-04-15T23:43:00+00:00] INFO: Processing template[/etc/chef/ohai_plugins/nginx.rb] action create (nginx::ohai_plugin line 27) [2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] updated content [2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] owner changed to 0 [2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] group changed to 0 [2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] mode changed to 755 [2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] sending reload action to ohai[reload_nginx] (immediate) [2013-04-15T23:43:00+00:00] INFO: Processing ohai[reload_nginx] action reload (nginx::ohai_plugin line 22) [2013-04-15T23:43:00+00:00] INFO: ohai[reload_nginx] reloaded [2013-04-15T23:43:00+00:00] INFO: Processing remote_directory[/etc/chef/ohai_plugins] action nothing (ohai::default line 30) [2013-04-15T23:43:00+00:00] INFO: Processing ohai[custom_plugins] action nothing (ohai::default line 44) [2013-04-15T23:43:00+00:00] INFO: Processing package[nginx] action install (nginx::default line 35) ================================================================================ Error executing action `install` on resource 'package[nginx]' ================================================================================ Chef::Exceptions::Exec ---------------------- apt-get -q -y install nginx=1.1.19-1 returned 100, expected 0 Resource Declaration: --------------------- # In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nginx/recipes/default.rb 34: end 35: package node['nginx']['package_name'] 36: service 'nginx' do Compiled Resource: ------------------ # Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nginx/recipes/default.rb:35:in `from_file' package("nginx") do retry_delay 2 retries 0 recipe_name "default" action :install cookbook_name :nginx package_name "nginx" end [2013-04-15T23:43:04+00:00] ERROR: Running exception handlers [2013-04-15T23:43:04+00:00] ERROR: Exception handlers complete [2013-04-15T23:43:04+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out [2013-04-15T23:43:04+00:00] FATAL: Chef::Exceptions::Exec: package[nginx] (nginx::default line 35) had an error: Chef::Exceptions::Exec: apt-get -q -y install nginx=1.1.19-1 returned 100, expected 0 Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete. </code></pre> <p>Chef Stacktrace</p> <pre><code>Generated at Mon Apr 15 23:43:04 +0000 2013 Chef::Exceptions::Exec: package[nginx] (nginx::default line 35) had an error: Chef::Exceptions::Exec: apt-get -q -y install nginx=1.1.19-1 returned 100, expected 0 /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/command.rb:128:in `handle_command_failures' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/command.rb:75:in `run_command' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/command.rb:143:in `run_command_with_systems_locale' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider/package/apt.rb:97:in `install_package' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider/package.rb:81:in `action_install' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:in `call' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:in `converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:in `each' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:in `converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:136:in `converge' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:125:in `run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:in `run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:49:in `run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `converge' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `each' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `converge' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:80:in `converge' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:378:in `converge' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:420:in `do_run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:176:in `run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:230:in `run_application' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:in `loop' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:in `run_application' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application.rb:70:in `run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/chef-solo:25 /opt/vagrant_ruby/bin/chef-solo:19:in `load' /opt/vagrant_ruby/bin/chef-solo:19 </code></pre> <p>So what am I missing here guys? Feel free to point me toward good reading material.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload