Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vagrant 101

Vagrant 101

Sanal makine orkestrasyon aracı Vagrant'a genel bakış.

Uğur Özyılmazel

April 15, 2015
Tweet

More Decks by Uğur Özyılmazel

Other Decks in Programming

Transcript

  1. config.vm.box = "hashicorp/precise64" config.vm.network "forwarded_port", guest: 80, host: 8080 #

    http://localhost:8080 => box'da:80 config.vm.network "private_network", ip: "192.168.33.101" config.vm.synced_folder ".", "/var/www" /vagrant Default mount
  2. vagrant -v | --version vagrant -h | --help vagrant ssh

    vagrant up vagrant halt vagrant destroy vagrant package vagrant global-status vagrant plugin list vagrant plugin install vagrant-vbguest vagrant box list vagrant box add USER/Box ?
  3. provider VirtualBox VMWare AWS Digital Ocean Rackspace Docker * Hyper-V

    * vagrant up --provider=vmware_fusion vagrant box list - hashicorp/precise64 (virtualbox, 1.1.0) * Ek konfigürasyon işlemleri gerekiyor
  4. provisioning inline file shell Ansible config.vm.provision "shell", inline: "echo hello"

    config.vm.provision "shell" do |s| s.inline = "echo hello" end Chef Salt Puppet Docker
  5. provisioning inline file shell Ansible # isimlendirilebiliyor config.vm.provision "bootstrap", type:

    "shell" do |s| s.inline = "echo hello" end Chef Salt Puppet Docker
  6. provisioning inline file shell Ansible # her seferinde çalışsın config.vm.provision

    "shell", inline: "echo hello", run: "always" Chef Salt Puppet Docker
  7. provisioning inline file shell Ansible # Host'daki .gitconfig'i, Guest'deki vagrant


    # kullanıcısının home'a kopyala... config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig" Chef Salt Puppet Docker
  8. provisioning inline file shell Ansible # script.sh'deki komutları çalıştır Vagrant.configure("2")

    do |config| config.vm.provision "shell", path: "script.sh" end Chef Salt Puppet Docker