Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add a vagrant config to spin multiple vms #2473

Merged
merged 1 commit into from Oct 5, 2023
Merged

Conversation

bruno-fs
Copy link
Contributor

@bruno-fs bruno-fs commented Sep 14, 2023

QoL for development. Easily spin multiple vms to run network scans locally.

My personal cheat sheet for vagrant:

# spin all vms
vagrant up
# get the ips
vagrant ssh-config | grep HostName | awk '{print $2}'
# tear everything down
vagrant destroy -f

Vagrantfile Show resolved Hide resolved
QoL for development. Easily spin multiple vms to run network scans
locally.

My personal cheat sheet for vagrant:
```
\# spin all vms
vagrant up
\# get the ips
vagrant ssh-config | grep HostName | awk '{print $2}'
\# tear everything down
vagrant destroy -f
```
@bruno-fs bruno-fs marked this pull request as ready for review October 5, 2023 14:13
@bruno-fs
Copy link
Contributor Author

bruno-fs commented Oct 5, 2023

Ah, the oneliner for grabbing IPs might not be enough depending on provider.
You might need to grab port too.

Copy link
Contributor

@mirekdlugosz mirekdlugosz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Member

@infinitewarp infinitewarp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took this branch for a test drive, and your Vagrantfile mostly works for me!

asciicast

The RHEL6 VM encountered an error running systemctl, and when everything was up, I wasn't able to SSH into the RHEL6 VM, but I didn't spend any time troubleshooting it. Is RHEL6 too old for the systemctl command? Did the RHEL6 VM setup work for you? Maybe I need to add a local ~/.ssh/config to allow the old weak ssh-rsa.

I successfully SSHed into all the other VMs, though! 🎉 I needed to include the port numbers when grepping the ssh-config like this:

vagrant ssh-config 2>/dev/null | grep -e '^Host\|\sHostName\|\sPort'

Vagrantfile Show resolved Hide resolved
@bruno-fs
Copy link
Contributor Author

bruno-fs commented Oct 5, 2023

Is RHEL6 too old for the systemctl command?

It is. service is there for RHEL6 (the error message can be safely ignored).
https://github.com/quipucords/quipucords/pull/2473/files#r1347832504

Did the RHEL6 VM setup work for you? Maybe I need to add a local ~/.ssh/config to allow the old weak ssh-rsa.

yup, it works, but I had to enable support for less secure kex algorithms

because this is so frequent (testlab running rhel6, ec2 running rhel6), I added to all my hosts on ~/.ssh/config

Host *
   HostkeyAlgorithms +ssh-rsa
   PubkeyAcceptedAlgorithms +ssh-rsa
   KexAlgorithms +diffie-hellman-group1-sha1

This is virtually what we have on discovery by enabling legacy compatibility

quipucords/Dockerfile

Lines 37 to 38 in 2e908b7

# set cryptographic policy to a mode compatible with older systems (like RHEL5&6)
RUN update-crypto-policies --set LEGACY

Copy link
Member

@infinitewarp infinitewarp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@bruno-fs bruno-fs merged commit 97b2ac2 into main Oct 5, 2023
9 checks passed
@bruno-fs bruno-fs deleted the vagrant-vms branch October 5, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants