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

Use Python 3 for ansible_local Vagrant provisioner #1269

Merged
merged 1 commit into from
Jan 30, 2021

Conversation

swalkinshaw
Copy link
Member

Fixes #1267

Pip doesn't support Python2 anymore so we're defaulting Vagrant to python3.

This defines a new config option vagrant_ansible_python_interpreter which defaults to /usr/bin/python3.

Pip doesn't support Python2 anymore so we're defaulting Vagrant to
python3.

This defines a new config option `vagrant_ansible_python_interpreter`
which defaults to `/usr/bin/python3`.
@@ -117,23 +117,11 @@ Vagrant.configure('2') do |config|
provisioner = local_provisioning? ? :ansible_local : :ansible
provisioning_path = local_provisioning? ? ANSIBLE_PATH_ON_VM : ANSIBLE_PATH

# Fix for https://github.com/hashicorp/vagrant/issues/10914
Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't needed anymore with the newer Ubuntu box versions apparently

# Fix for https://github.com/hashicorp/vagrant/issues/10950
ansible.pip_install_cmd = 'curl https://bootstrap.pypa.io/get-pip.py | sudo python'
end
ansible.pip_install_cmd = 'sudo apt-get install -y -qq python3-distutils && curl https://bootstrap.pypa.io/get-pip.py | sudo python3'
Copy link
Member Author

Choose a reason for hiding this comment

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

Might as well just always set this 🤷‍♂️

@swalkinshaw swalkinshaw merged commit 408f994 into master Jan 30, 2021
@swalkinshaw swalkinshaw deleted the vagrant-use-python3 branch January 30, 2021 04:12
@swalkinshaw swalkinshaw changed the title Vagrant: use python3 Use Python 3 for ansible_local Vagrant provisioner Jan 30, 2021
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.

Failed to install pip on vagrant provision
2 participants