{"id":368,"date":"2014-09-14T17:01:00","date_gmt":"2014-09-14T21:01:00","guid":{"rendered":"http:\/\/devopsny.com\/blog\/?p=368"},"modified":"2014-09-14T17:01:00","modified_gmt":"2014-09-14T21:01:00","slug":"up-and-running-chef-solo-instance-using-vagrant","status":"publish","type":"post","link":"https:\/\/devopsny.com\/blog\/2014\/09\/14\/up-and-running-chef-solo-instance-using-vagrant\/","title":{"rendered":"Up and running chef-solo instance using Vagrant"},"content":{"rendered":"<p>This will describe a quick and easy way to get a chef-solo instance up and running using Vagrant. This document is intended for learning Chef and not intended for production use.<\/p>\n<p>I am using Mac OS X for this tutorial. I am sure it is simiar for Windows and Linux.<\/p>\n<h1>Prerequisites<\/h1>\n<ul>\n<li>Oracle Virtual Box &#8211;\u00a0<a title=\"Download Virtual Box\" href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads\" target=\"_blank\">Download<\/a><\/li>\n<li>Vagrant &#8211; <a title=\"Download Vagrant\" href=\"https:\/\/www.vagrantup.com\/downloads.html\" target=\"_blank\">Download<\/a><\/li>\n<li>Working knowledge of Vagrant<\/li>\n<\/ul>\n<h1>\u00a0Setting It Up<\/h1>\n<p>Create a directory for the Vagrantfile and bootstrap.sh. I named mine chef_solo. Change into that directory and create a Vagrantfile with the following:<\/p>\n<pre>Vagrant.configure(\"2\") do |config|\r\n  config.vm.box = \"ubuntu\/trusty64\"\r\n  config.vm.provision :shell, path: \"bootstrap.sh\"\r\nend\r\n<\/pre>\n<p>This will spin up an Ubuntu server 14.04 64 bit instance and run bootstrap.sh.<\/p>\n<p>Now edit bootstrap.sh and add the following:<\/p>\n<pre>#!\/usr\/bin\/env bash\r\n\r\napt-get update\r\napt-get install -y curl\r\ncurl -L https:\/\/www.opscode.com\/chef\/install.sh | bash\r\nchef-solo -v<\/pre>\n<p>Once the VM is up and running, bootstrap.sh will apply updates, install curl, download and install chef-solo using the Omnibus installer, and print out the version of Chef.<\/p>\n<h1>Chef-solo up and running<\/h1>\n<p>Now simply run vagrant up and your chef-solo instance will be installed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This will describe a quick and easy way to get a chef-solo instance up and running using Vagrant. This document is intended for learning Chef and not intended for production use. I am using Mac OS X for this tutorial. I am sure it is simiar for Windows and Linux. Prerequisites Oracle Virtual Box &#8211;\u00a0Download [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[188,190,64,191],"tags":[192,193],"class_list":["post-368","post","type-post","status-publish","format-standard","hentry","category-14-04-lts","category-chef","category-devops","category-vagrant","tag-chef-2","tag-vagrant-2"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3fcrv-5W","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/posts\/368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/comments?post=368"}],"version-history":[{"count":2,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/posts\/368\/revisions"}],"predecessor-version":[{"id":370,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/posts\/368\/revisions\/370"}],"wp:attachment":[{"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/media?parent=368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/categories?post=368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/tags?post=368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}