Vagrant chef

Embed Size (px)

DESCRIPTION

Vagrant & chef

Text of Vagrant chef

  • 1. Vagrant + ChefHiroki Nigorinuma1354
  • 2. IndexPreparedVagrantle & CommandsServer StandardChef StructureChef Resources1354
  • 3. Preparedinstall Virtual Boxhttps://www.virtualbox.org/wiki/Downloadsinstall vagrantgem install vagrant1354
  • 4. Vagrant Box Addvagrant box add [box name] [URL]vagrant box add CentOS-6.4 http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130309.boxvagrant box list1354
  • 5. Vagrant Settingmkdir [project name]cd [project name]vagrant init -> appear Vagrantle1354
  • 6. VagrantleVagrantlevagrant standard setting lefor Example1354
  • 7. Vagrantle detailcong.vm.box = [box name]Select using boxcong.vm.network :hostonly, [address]Setting IP addressminimum necessary !!1354
  • 8. Vagrant CommnadsVagrant up -> server startVagrant reload -> server restartVagrant ssh -> ssh to serverVagrant halt -> server shutdownVagrant destroy -> destroy serverVagrant provision -> efcient chef1354
  • 9. Server Standardminimum necessary setPHP + MySQL + ApacheRuby + MySQL + ApacheRuby + PostgreSQL + Nginx...etc1354
  • 10. Chef Structure 1[project]/Vagrantlecookbooks/[setting directory]/1354
  • 11. Chef Structure 2[setting directory]/recipes/default.rbtemplates/default/[le name].erbattributes/[le name].rb...etcminimum necessary !!1354
  • 12. Setting directoryOpscode git repositoryhttps://github.com/opscode-cookbooksgit clone [repository URL]standard setting but too many les1354
  • 13. Chef Resourcesfor original settingResourcespackage -> installtemplate -> read template leexecute -> run commandservice -> start, restart, stop ...directory -> make directory...etc1354
  • 14. Chef ResourcesSyntax[resources] [application_name] doaction [option], ...[attributes] [option], ...endGeneralFor examplepackage mysql doaction :installversion 5.5end1354
  • 15. Packageinstall , upgrade, remove, ...yum_package -> defaultyum install ~rpm_packagegem_package...etc1354
  • 16. Templatestemplate /etc/mysql/my.cnf dosource my.cnf.erbpath /etc/mysql/my.cnfendtemplates/default/my.cnf.erb1354
  • 17. Notehttp://docs.opscode.com/search.html1354