Last active
December 30, 2015 13:29
-
-
Save rosswd/286795f459d3b94acb27 to your computer and use it in GitHub Desktop.
Playing with chef.
This file contains 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
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 |
This file contains 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
# 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