When I run the playbook the first time it fails with
FAILED! => {“changed”: false, “msg”: “Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on myhost 's Python /usr/bin/python3. Please read module documentation and install in the appropriate location, for example via pip install docker or pip install docker-py (Python 2.6). The error was: No module named ‘docker’”}
But if ti runs the second time no issue at all.
Any idea why? I thought it was cause it can’t find the path for PIP … but not sure.
Cheers
I have observed the same for our GCP instances where i am running docker on VM . Then, i had to uninstall via “pip uninstall docker” and then re-install it - “pip install docker” . Issues get resolved .
After uninstall via “pip uninstall docker” and then use “pip install docker --upgrade” , if that also didnt work - u need to un-install docker-compose as well “pip uninstall docker-compose” , it should work then
Here is my vagrant file
(1…3).each do |i|
config.vm.define “iri-0#{i}” do |node|
node.vm.box = “ubuntu/bionic64”
node.vm.box_version = “20190918.0.0”
node.vm.network “private_network”, ip: “#{SUBNET}.1#{i}”
node.vm.hostname = “imi-0#{i}”
node.vm.provider :virtualbox do |v|
v.cpus = 3
v.memory = 3072
end
end
end
So basically is Ubuntu Bionic Vm create with Virtualbox