This guide provides how to urn multiple machines with the fix of itmezone issues in vagrant
Pre-req :
Install latest vagrant
Install latest Oracle vmware.
before starting
vagrant up or vagrant up pg1/2/3
Install the below on vagrant windows machine :
vagrant install plugin vagrant-timezone
If windows 10 thrown some error then it might have caused last patch installation. Reboot the machine and try again.
*********************************************************************************************************
The below provides clean 3 node vagrant instllation with timezone fix
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
echo I am provisioning...
date > /etc/vagrant_provisioned_at
SCRIPT
Vagrant.configure("2") do |config|
if Vagrant.has_plugin?("vagrant-timezone")
config.timezone.value = "America/New_York"
end
# ... other stuff
config.vm.define "pg1" do |pg1|
pg1.vm.box = "weiishann/centos7-pg11beta2"
pg1.vm.hostname = 'pg1'
pg1.vm.box_url = "weiishann/centos7-pg11beta2"
pg1.vm.network :private_network, ip: "192.168.56.101"
pg1.vm.provision :shell, :path => "Vagrant-setup/bootstrap.sh"
pg1.vm.network "forwarded_port", guest: 5432, host: 5430
pg1.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 1024]
v.customize ["modifyvm", :id, "--name", "pg1"]
end
end
config.vm.define "pg2" do |pg2|
pg2.vm.box = "weiishann/centos7-pg11beta2"
pg2.vm.hostname = 'pg2'
pg2.vm.box_url = "weiishann/centos7-pg11beta2"
pg2.vm.network :private_network, ip: "192.168.56.102"
pg2.vm.provision :shell, :path => "Vagrant-setup/bootstrap.sh"
pg2.vm.network "forwarded_port", guest: 5432, host: 5431
pg2.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 1024]
v.customize ["modifyvm", :id, "--name", "pg2"]
end
end
config.vm.define "pg3" do |pg3|
pg3.vm.box = "weiishann/centos7-pg11beta2"
pg3.vm.hostname = 'pg3'
pg3.vm.box_url = "weiishann/centos7-pg11beta2"
pg3.vm.network :private_network, ip: "192.168.56.103"
pg3.vm.provision :shell, :path => "Vagrant-setup/bootstrap.sh"
pg3.vm.network "forwarded_port", guest: 5432, host: 5433
pg3.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 512]
v.customize ["modifyvm", :id, "--name", "pg3"]
end
end
end
Pre-req :
Install latest vagrant
Install latest Oracle vmware.
before starting
vagrant up or vagrant up pg1/2/3
Install the below on vagrant windows machine :
vagrant install plugin vagrant-timezone
If windows 10 thrown some error then it might have caused last patch installation. Reboot the machine and try again.
*********************************************************************************************************
The below provides clean 3 node vagrant instllation with timezone fix
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
echo I am provisioning...
date > /etc/vagrant_provisioned_at
SCRIPT
Vagrant.configure("2") do |config|
if Vagrant.has_plugin?("vagrant-timezone")
config.timezone.value = "America/New_York"
end
# ... other stuff
config.vm.define "pg1" do |pg1|
pg1.vm.box = "weiishann/centos7-pg11beta2"
pg1.vm.hostname = 'pg1'
pg1.vm.box_url = "weiishann/centos7-pg11beta2"
pg1.vm.network :private_network, ip: "192.168.56.101"
pg1.vm.provision :shell, :path => "Vagrant-setup/bootstrap.sh"
pg1.vm.network "forwarded_port", guest: 5432, host: 5430
pg1.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 1024]
v.customize ["modifyvm", :id, "--name", "pg1"]
end
end
config.vm.define "pg2" do |pg2|
pg2.vm.box = "weiishann/centos7-pg11beta2"
pg2.vm.hostname = 'pg2'
pg2.vm.box_url = "weiishann/centos7-pg11beta2"
pg2.vm.network :private_network, ip: "192.168.56.102"
pg2.vm.provision :shell, :path => "Vagrant-setup/bootstrap.sh"
pg2.vm.network "forwarded_port", guest: 5432, host: 5431
pg2.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 1024]
v.customize ["modifyvm", :id, "--name", "pg2"]
end
end
config.vm.define "pg3" do |pg3|
pg3.vm.box = "weiishann/centos7-pg11beta2"
pg3.vm.hostname = 'pg3'
pg3.vm.box_url = "weiishann/centos7-pg11beta2"
pg3.vm.network :private_network, ip: "192.168.56.103"
pg3.vm.provision :shell, :path => "Vagrant-setup/bootstrap.sh"
pg3.vm.network "forwarded_port", guest: 5432, host: 5433
pg3.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 512]
v.customize ["modifyvm", :id, "--name", "pg3"]
end
end
end
Comments
Post a Comment