Skip to content

Commit

Permalink
chore: add a vagrant config to spin multiple vms
Browse files Browse the repository at this point in the history
QoL for development. Easily spin multiple vms to run network scans
locally.

My personal cheat sheet for vagrant:
```
vagrant up
vagrant ssh-config | grep HostName | awk '{print $2}'
vagrant destroy -f
```
  • Loading branch information
bruno-fs committed Sep 14, 2023
1 parent 39f2655 commit 909c893
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -133,3 +133,6 @@ quipucords/roles/

# local files
var/

# vagrant data
.vagrant/
21 changes: 21 additions & 0 deletions Vagrantfile
@@ -0,0 +1,21 @@
Vagrant.configure("2") do |config|
# unnoficial RHEL images
(6..9).each do |n|
config.vm.define "rhel%d" % n do |vmconfig|
vmconfig.vm.box = "generic/rhel%d" % n
end
end
# unnoficial centos stream images (for testing purposes we can consider them RHEL)
(8..9).each do |n|
config.vm.define "stream%d" % n do |vmconfig|
# we could use the official "centos/stream%d" images, but I'm unable to boot stream9 :'(
vmconfig.vm.box = "generic/centos%ds" % n
end
end
# allow ssh'ing with password authentication (username and password is "vagrant")
config.vm.provision "shell", inline: <<-EOF
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
# fallback to service for systems that don't use systemd
systemctl restart sshd.service || service sshd restart
EOF
end

0 comments on commit 909c893

Please sign in to comment.