Skip to content

Instantly share code, notes, and snippets.

@toruuetani
Last active August 29, 2015 14:03
Show Gist options
  • Save toruuetani/10227e933024471a6679 to your computer and use it in GitHub Desktop.
Save toruuetani/10227e933024471a6679 to your computer and use it in GitHub Desktop.
Vagrant 1.6.3 作業ログ

インストール

  • vagrant_1.6.3.msi
vagrant plugin list
=> vagrant-login (1.0.1, system)
=> vagrant-share (1.1.0, system)
vagrant plugin install vagrant-omnibus
=> vagrant-omnibus (1.4.1)
vagrant plugin install vagrant-aws
=> vagrant-aws (0.5.0)

plugin は C:\Users\[UserName]\.vagrant.d\gems\gems にインストールされる。

BaseBox 登録

vagrant box add Win7x86 [path_to_box]

Vagrantfile

# -*- encoding: utf-8 -*-


def support_win_guest?
  version = /(?<major>\d+)\.(?<minor>\d+)(\.\d+)*/.match(Vagrant::VERSION)
  version[:major].to_i >= 1 and version[:minor].to_i >= 6
end


VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "win7x86"
  if support_win_guest?
    config.vm.communicator = "winrm"
  end

  config.vm.provider "virtualbox" do |vb|
    vb.gui = true
  end
end

Dotenv

http://blog.glidenote.com/blog/2014/02/26/vagrant-dotenv/

  • インストールは vagrant plugin install dotenv
  • VCSに登録したくない情報は .env ファイルに格納し、 #{ENV['HOGE_KEY']} のように記述する。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment