vagrant chef
DESCRIPTION
Vagrant & chefTRANSCRIPT
Vagrant + ChefHiroki Nigorinuma
13年5月4日土曜日
Index
Prepared
Vagrantfile & Commands
Server Standard
Chef Structure
Chef Resources
13年5月4日土曜日
Prepared
install Virtual Box
https://www.virtualbox.org/wiki/Downloads
install vagrant
gem install vagrant
13年5月4日土曜日
Vagrant Box Add
vagrant box add [box name] [URL]
vagrant box add CentOS-6.4 http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130309.box
vagrant box list
13年5月4日土曜日
Vagrant Setting
mkdir [project name]
cd [project name]
vagrant init -> appear Vagrantfile
13年5月4日土曜日
VagrantfileVagrantfile
vagrant standard setting file
for Example
13年5月4日土曜日
Vagrantfile detail
config.vm.box = “[box name]”
Select using box
config.vm.network :hostonly, “[address]”
Setting IP address
minimum necessary !!
13年5月4日土曜日
Vagrant CommnadsVagrant up -> server start
Vagrant reload -> server restart
Vagrant ssh -> ssh to server
Vagrant halt -> server shutdown
Vagrant destroy -> destroy server
Vagrant provision -> efficient chef
13年5月4日土曜日
Server Standard
minimum necessary set
PHP + MySQL + Apache
Ruby + MySQL + Apache
Ruby + PostgreSQL + Nginx
...etc
13年5月4日土曜日
Chef Structure 1
[project]/
Vagrantfile
cookbooks/
[setting directory]/
13年5月4日土曜日
Chef Structure 2[setting directory]/
recipes/
default.rb
templates/
default/
[file name].erb
attributes/
[file name].rb
...etc
minimum necessary !!13年5月4日土曜日
Setting directory
Opscode git repository
https://github.com/opscode-cookbooks
git clone [repository URL]
standard setting but too many files
13年5月4日土曜日
Chef Resourcesfor original settingResources
package -> install
template -> read template file
execute -> run command
service -> start, restart, stop ...
directory -> make directory
...etc
13年5月4日土曜日
Chef Resources Syntax
[resources] [application_name] do action [option], ... [attributes] [option], ...end
General
For examplepackage “mysql” do action :install version “5.5”end
13年5月4日土曜日
Packageinstall , upgrade, remove, ...
yum_package -> default
yum install ~
rpm_package
gem_package
...etc
13年5月4日土曜日
Templatestemplate “/etc/mysql/my.cnf” do source “my.cnf.erb” path “/etc/mysql/my.cnf”end
templates/default/
my.cnf.erb
13年5月4日土曜日
Note
http://docs.opscode.com/search.html
13年5月4日土曜日