Skip to content

Instantly share code, notes, and snippets.

@HalisCz
Last active September 19, 2022 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save HalisCz/42752c7f9761946f2187fab63a386706 to your computer and use it in GitHub Desktop.
Save HalisCz/42752c7f9761946f2187fab63a386706 to your computer and use it in GitHub Desktop.
# -*- 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/kinetic64"
ubuntu.vm.network "private_network",
ip: "192.168.56.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 "rocky" do |rocky|
rocky.vm.hostname = "rocky"
# We are going to use unofficial image, because official one does not contain
# VirtualBox Guest Additions required to set network and synced folder
rocky.vm.box = "boxomatic/rocky-8"
rocky.vm.network "private_network",
ip: "192.168.56.15"
rocky.vm.synced_folder "./data-rocky", "/vagrant_data", create: true
rocky.vm.provision "shell", inline: <<-SHELL
yum -y update
SHELL
end
end
@HalisCz
Copy link
Author

HalisCz commented Apr 4, 2019

mkdir ansible-skoleni
cd ansible-skoleni
wget -O Vagrantfile https://gist.githubusercontent.com/HalisCz/42752c7f9761946f2187fab63a386706/raw/cb04b4a19fa4281919133040dfdf55026d661806/Vagrantfile
vagrant up

@HalisCz
Copy link
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 rocky
sudo su -
vi ~/.ssh/authorized_keys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment