Skip to content

Instantly share code, notes, and snippets.

@arawn
Created December 23, 2012 23:52
Show Gist options
  • Save arawn/4366784 to your computer and use it in GitHub Desktop.
Save arawn/4366784 to your computer and use it in GitHub Desktop.
제10회 개발자를 위한 ‘共感(공감)’ 세미나 - Session 5 Vagrant와 Chef로 개발서버 구축 자동화하기에서 사용된 예제의 Vagrantfile 입니다.
include_recipe "mysql::ruby"
connection_info = {
:host => "localhost",
:username => "root",
:password => node['mysql']['server_root_password']
}
db_name = "example"
db_username = "example"
db_password = node['mysql']['server_root_password']
mysql_database db_name do
connection connection_info
encoding "utf8"
collation "utf8_general_ci"
action :create
end
mysql_database_user db_username do
connection connection_info
database_name db_name
password db_password
action :grant
end
mysql_database_user db_username do
connection connection_info
database_name db_name
password db_password
host '%'
action :grant
end
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "opscode-ubuntu-12.04"
config.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-ubuntu-12.04.box"
config.vm.forward_port 3306, 3306
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.log_level = :info
chef.add_recipe "apt"
chef.add_recipe "openssl"
chef.add_recipe "build-essential"
chef.add_recipe "mysql::server"
chef.add_recipe "database::example"
chef.json = {
:mysql => {
:server_root_password => "vagrant",
:server_repl_password => "vagrant",
:server_debian_password => "vagrant"
}
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment