Skip to content

Instantly share code, notes, and snippets.

@bornknow108
Last active December 28, 2015 18:09
Show Gist options
  • Select an option

  • Save bornknow108/7540532 to your computer and use it in GitHub Desktop.

Select an option

Save bornknow108/7540532 to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# vagrant box add で追加したBOX名
config.vm.box = "centos64"
# ポートフォワードの設定 localhost:8080 => vagrant:80
config.vm.network :forwarded_port, guest: 80, host: 8080
# プライベートネットワークでの Vagrant の IP アドレス
config.vm.network :private_network, ip: "192.168.33.10"
# 同期フォルダの設定
config.vm.synced_folder "../", "/var/www/share", \
create:true, owner: 'vagrant', \
group: 'vagrant', mount_options: ['dmode=777,fmode=666']
config.vm.provider :virtualbox do |vb|
# メモリの設定(512MB)
vb.customize ["modifyvm", :id, "--memory", 512]
end
# Chef のインストール
# 事前に Vagrant のプラグインをインストールしておくこと
# $ vagrant plugin install vagrant-omnibus
# $ vagrant plugin install vagrant-berkshelf
# $ sudo gem install berkshelf
config.berkshelf.enabled = true
config.omnibus.chef_version = :latest
# Chef の設定
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
chef.run_list = ["recipe[yum]","recipe[php]","recipe[mysql]","recipe[apache2]","recipe[base]"]
chef.json = {
apache: {
default_site_enabled: true,
docroot_dir: "/var/www/share"
},
mysql: {
server_root_password: "xxxxxxxxxx" # パスワード
}
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment