Created
July 20, 2017 16:39
-
-
Save amanualt/b45a2f7a39f5104113c3ee451fd5ea2d to your computer and use it in GitHub Desktop.
install centos on vagrant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
#config.vm.box = "centos/7" | |
#config.vm.provision :shell, :path => "bootstrap.sh" | |
config.vm.define "lab1" do |m| | |
m.vm.box = "centos/7" | |
m.vm.network "private_network", ip: "192.168.7.11" | |
m.vm.provision "shell", inline: "hostnamectl set-hostname lab1" | |
m.vm.provision "shell", inline: "cd /vagrant;sudo make repo;sudo yum install -y ntpdate ntp;sudo systemctl enable ntpd;sudo ntpdate id.pool.ntp.org;sudo service ntpd start" | |
m.vm.provision :shell, :inline => "sudo rm /etc/localtime && sudo ln -s /usr/share/zoneinfo/Asia/Jakarta /etc/localtime", run: "always" | |
end | |
config.vm.define "lab2" do |s1| | |
s1.vm.box = "centos/7" | |
s1.vm.network "private_network", ip: "192.168.7.12" | |
s1.vm.provision "shell", inline: "hostnamectl set-hostname lab2" | |
s1.vm.provision "shell", inline: "cd /vagrant;sudo make repo;sudo yum install -y ntpdate ntp;sudo systemctl enable ntpd;sudo ntpdate id.pool.ntp.org;sudo service ntpd start" | |
s1.vm.provision :shell, :inline => "sudo rm /etc/localtime && sudo ln -s /usr/share/zoneinfo/Asia/Jakarta /etc/localtime", run: "always" | |
end | |
config.vm.network "private_network", type: "dhcp" | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = "512" | |
vb.cpus = "1" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment