AnwarYagoub / RHCSA-RHCE-Lab-Environment

Lab environment for RHCSA/RHCE Cert Guide book by Sander van Vugt (not official)
https://anwaryagoub.github.io/RHCSA-RHCE-Lab-Environment/
77 stars 50 forks source link

wrong python version used in script executed by vagrant up #33

Closed jyscao closed 3 years ago

jyscao commented 3 years ago

First off, thanks for putting together this lab environment set-up, it's immensely helpful.

I'm just testing it out for the first time, and after successfully installing VirtualBox, Vagrant and cloning the git repo, I ran vagrant up server1. Most scripts appeared to be running fine, until it reached the following:

==> server1: Running provisioner: ansible_local...
    server1: Installing Ansible...
    server1: Installing pip... (for Ansible installation)
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

curl https://bootstrap.pypa.io/get-pip.py | sudo python

Stdout from the command:

ERROR: This script does not work on Python 2.7 The minimum supported Python version is 3.6. Please use https://bootstrap.pypa.io/2.7/get-pip.py instead.

This is my first time using Vagrant, so I'm not entirely sure what's causing the error. But if it means what I think it means, then the error is likely due to the python binary defaulting to v2.7.18 on my system. So I'm thinking changing that script line to https://bootstrap.pypa.io/get-pip.py | sudo python3 should resolve this error.

But I'm unsure where I'd make this change. Can you help me out?

jyscao commented 3 years ago

The workaround that works for me is to change every line of ansible.install_mode = "pip" in the Vagrantfile to ansible.install_mode = "pip3".