Skip to content

Instantly share code, notes, and snippets.

@cobracmder
Created May 23, 2014 14:53
Show Gist options
  • Save cobracmder/8fcceaaf02654ed9c804 to your computer and use it in GitHub Desktop.
Save cobracmder/8fcceaaf02654ed9c804 to your computer and use it in GitHub Desktop.
Vagrant and Ansible demo
node1 ansible_ssh_host=10.1.0.2
node2 ansible_ssh_host=10.1.0.3
node3 ansible_ssh_host=10.1.0.4
[all:vars]
external_ntp_host = otc1.psu.edu
[group1]
node1
[group2]
node3
[group3:children]
group1
group2
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.define "node1" do |machine|
machine.vm.network :private_network, ip: "10.1.0.2",
:netmask => "255.255.0.0"
machine.vm.hostname = "node1"
machine.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--memory", 768]
end
end
config.vm.define "node2" do |machine|
machine.vm.network :private_network, ip: "10.1.0.3",
:netmask => "255.255.0.0"
machine.vm.hostname = "node2"
machine.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--memory", 768]
end
end
config.vm.define "node3" do |machine|
machine.vm.network :private_network, ip: "10.1.0.4",
:netmask => "255.255.0.0"
machine.vm.hostname = "node3"
machine.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--memory", 512]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment