Skip to content

Instantly share code, notes, and snippets.

@bborysenko
Created January 11, 2019 21:10
Show Gist options
  • Save bborysenko/3cd5f6c563e0ccc8f16be2cc64665050 to your computer and use it in GitHub Desktop.
Save bborysenko/3cd5f6c563e0ccc8f16be2cc64665050 to your computer and use it in GitHub Desktop.
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'digital_ocean'
Vagrant.configure("2") do |config|
config.vm.box = 'digital_ocean'
config.vm.box_url = 'https://github.com/devopsgroup-io/vagrant-digitalocean/raw/master/box/digital_ocean.box'
config.ssh.private_key_path = '~/.ssh/vagrant'
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.allowed_synced_folder_types = :rsync
config.nfs.functional = false
config.vm.provider :digital_ocean do |provider, override|
provider.token = ENV['DIGITALOCEAN_ACCESS_TOKEN']
provider.image = "centos-7-x64"
provider.region = "fra1"
provider.size = "s-2vcpu-2gb"
provider.private_networking = true
end
(1..3).each do |i|
config.vm.define vm_name = "%s-%01d" % ["node", i] do |node|
node.vm.hostname = $vm_name
if i == 3
node.vm.provision :ansible do |ansible|
ansible.limit = "all"
ansible.playbook = "site.yml"
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment