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

vagrant build not working #261

Closed
julianwieg opened this issue Apr 30, 2020 · 3 comments
Closed

vagrant build not working #261

julianwieg opened this issue Apr 30, 2020 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@julianwieg
Copy link

julianwieg commented Apr 30, 2020

Hello,

not a python dev but when vagrant is used the terraform modules are loaded and the code bombs out.... Then I comment out the terraform module import and the vagrant bombs out.

Should the modules not all be in the library and just work?

user@ubuntu1:~/attack_range$ python attack_range.py -m vagrant -a build Traceback (most recent call last): File "attack_range.py", line 7, in <module> from modules.TerraformController import TerraformController File "/home/user/attack_range/modules/TerraformController.py", line 4, in <module> from modules import aws_service, splunk_sdk File "/home/user/attack_range/modules/aws_service.py", line 3, in <module> import boto3 ModuleNotFoundError: No module named 'boto3'

no terraform module import
(venv) user@ubuntu1:~/attack_range$ python attack_range.py -m vagrant -a build Traceback (most recent call last): File "attack_range.py", line 8, in <module> from modules.VagrantController import VagrantController File "/home/user/attack_range/modules/VagrantController.py", line 7, in <module> import ansible_runner ModuleNotFoundError: No module named 'ansible_runner' (venv) 1 user@ubuntu1:~/attack_range$

`

@josehelps
Copy link
Contributor

josehelps commented Apr 30, 2020

Do you mind retrying to configure vagrant .. looking at the output it seems like either libraries were not installed eg: pip install -r requirements.txt or currently on the wrong virtualenv. But see step 2 on pre-reqs in the doc. If running that still returning No module name errors. Please run which pip and or whereis pip and share the output with us.

@josehelps josehelps self-assigned this Apr 30, 2020
@josehelps josehelps added the question Further information is requested label Apr 30, 2020
@julianwieg
Copy link
Author

dumb me. Maybe update your documentation for noobs; maybe I should write a guide if I get it working later also :)

  1. In Ubuntu the pip could not install psutil from requirements.txt -> failed.
  2. This can be fixed by installing python-dev = sudo apt-get install python3.6-dev
  3. I earlier manually installed psutil but not in the virtualenv enviroment
  4. I also executed the attack range script outside the venv virtualenv enviroment

@josehelps
Copy link
Contributor

@julianwieg updated the wiki to include your guide, thank you so much for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants