Skip to content

Instantly share code, notes, and snippets.

@rosswd
Last active December 30, 2015 13:29
Show Gist options
  • Save rosswd/286795f459d3b94acb27 to your computer and use it in GitHub Desktop.
Save rosswd/286795f459d3b94acb27 to your computer and use it in GitHub Desktop.
Playing with chef.
Vagrant.configure("2") do |config|
config.vm.provision "chef_solo" do |chef|
#chef.cookbooks_path = "../my_recipes/cookbooks"
chef.roles_path = "../my_recipes/roles"
chef.add_role("web")
chef.data_bags_path = "../my_recipes/data_bags"
chef.node_name = "foo"
chef.add_recipe "apache"
chef.add_recipe "apt"
chef.add_recipe "build-essential"
chef.add_recipe "rvm::vagrant"
chef.add_recipe "rvm::system"
chef.add_recipe "git"
chef.add_recipe "mysql"
chef.json = {
"apache" => {
"listen_address" => "0.0.0.0"
},
"mysql" = > {
"mysql_password" => "foo"
}
}
end
end
# http://www.base2.io/2012/05/01/vagrants-and-chefs-and-librarians-oh-my/
# http://docs.vagrantup.com/v2/provisioning/chef_solo.html
# Syntax (Resources and Providers)
type "name" do
attribute "value"
action :type_of_action
end
# Example of installing 'tar'
package "tar" do
version "1.16"
action :install
end
directory "/tmp/folder" do
owner "root"
group "root"
mode 0755
action :create
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment