Skip to content

Instantly share code, notes, and snippets.

@atosatto
Last active July 26, 2018 06:57
Show Gist options
  • Save atosatto/39c6a51ad241a43938b5dc413035ff27 to your computer and use it in GitHub Desktop.
Save atosatto/39c6a51ad241a43938b5dc413035ff27 to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Use CentOS 7 as base image
config.vm.box = "centos/7"
# Disable automatic box update checking.
# Check with `vagrant box outdated` whether the currently
# installed centos/7 box is outdated.
config.vm.box_check_update = false
# Disable SSH keys generation and injection to allow
# the host running the Ansible to connect to the other hosts
config.ssh.insert_key = false
# Each machine will have two nics attached to the private
# network and configured via DHCP
config.vm.network "private_network", type: "dhcp"
# Share the 'current' folder with the guest vm.
config.vm.synced_folder ".", "/vagrant"
# Virtualbox specific settings.
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM
vb.memory = "1024"
end
# if vagrant-hostsupdater is installed,
# automatically update the /etc/hosts file
# vagrant plugin install vagrant-hostmanager
if Vagrant.has_plugin?("vagrant-hostmanager")
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
end
VMS = [ "pdns-rec-01", "pdns-mon-01" ]
VMS.each do |vm|
config.vm.define "%s" % vm do |pdns|
pdns.vm.hostname = vm
if Vagrant.has_plugin?("vagrant-hostmanager")
pdns.hostmanager.aliases = [ "%s.pdns.lab" % vm.delete("pdns-") ]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment