Set python version to 2.7 as all other ansible provisioners do

This commit is contained in:
Alexzander thunder Shevchenko 2020-04-05 14:46:33 +03:00
parent 76e098039b
commit d1d214f6e2
2 changed files with 6 additions and 9 deletions

View File

@ -24,13 +24,12 @@ module VagrantPlugins
private
def self.ansible_apk_install(machine)
machine.communicate.sudo "apk add --update --no-cache python3 ansible"
machine.communicate.sudo "apk add --update --no-cache python ansible"
end
def self.pip_setup(machine, pip_install_cmd = "")
machine.communicate.sudo "apk add --update --no-cache python3"
machine.communicate.sudo "if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi"
machine.communicate.sudo "apk add --update --no-cache --virtual .build-deps python3-dev libffi-dev openssl-dev build-base"
machine.communicate.sudo "apk add --update --no-cache python"
machine.communicate.sudo "apk add --update --no-cache --virtual .build-deps python-dev libffi-dev openssl-dev build-base"
Pip::get_pip machine, pip_install_cmd
end

View File

@ -26,11 +26,9 @@ describe VagrantPlugins::Ansible::Cap::Guest::Alpine::AnsibleInstall do
describe "#pip_setup" do
it "install required alpine packages for pip" do
expect(communicator).to receive(:sudo).once.ordered.
with("apk add --update --no-cache python3")
with("apk add --update --no-cache python")
expect(communicator).to receive(:sudo).once.ordered.
with("if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi")
expect(communicator).to receive(:sudo).once.ordered.
with("apk add --update --no-cache --virtual .build-deps python3-dev libffi-dev openssl-dev build-base")
with("apk add --update --no-cache --virtual .build-deps python-dev libffi-dev openssl-dev build-base")
subject.pip_setup(machine)
end
@ -43,7 +41,7 @@ describe VagrantPlugins::Ansible::Cap::Guest::Alpine::AnsibleInstall do
describe "when install_mode is :default (or unknown)" do
it "installs ansible with 'apk' package manager" do
expect(communicator).to receive(:sudo).once.ordered.
with("apk add --update --no-cache python3 ansible")
with("apk add --update --no-cache python ansible")
subject.ansible_install(machine, :default, "", "", "")
end