Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# -*- mode: ruby -*- vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "ubuntu" do |ubuntu|
ubuntu.vm.hostname = "ubuntu"
ubuntu.vm.box = "ubuntu/bionic64"
ubuntu.vm.network "private_network",
ip: "172.29.29.14"
ubuntu.vm.synced_folder "./data-ubuntu", "/vagrant_data", create: true
ubuntu.vm.provision "shell", inline: <<-SHELL
apt-get update
SHELL
end
config.vm.define "centos" do |centos|
centos.vm.hostname = "centos"
# We are going to use unofficial image, because official one does not contain
# VirtualBox Guest Additions required to set network and synced folder
centos.vm.box = "geerlingguy/centos7"
centos.vm.network "private_network",
ip: "172.29.29.15"
centos.vm.synced_folder "./data-centos", "/vagrant_data", create: true
centos.vm.provision "shell", inline: <<-SHELL
yum -y update
SHELL
end
end
@HalisCz

This comment has been minimized.

Copy link
Owner Author

HalisCz commented Apr 4, 2019

mkdir ansible-skoleni
cd ansible-skoleni
wget -O Vagrantfile https://gist.github.com/HalisCz/42752c7f9761946f2187fab63a386706/raw/34c09ec5963b3cfc8dfbdff41795c23ff11ddf3d/Vagrantfile
vagrant up
@HalisCz

This comment has been minimized.

Copy link
Owner Author

HalisCz commented Apr 4, 2019

vagrant ssh ubuntu
sudo su -
ssh-keygen
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_rsa.pub
exit
exit
vagrant ssh centos
sudo su -
vi ~/.ssh/authorized_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.