You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be too specific an error but it happened to me. In Ch.3 section "docker_image module" we start with the playbook for building the Docker image, using the docker_image module.
Running the playbook at this point (before moving on to the next section) resulted in an error for me:
"msg": "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on penguin's Python /usr/bin/python. Please read module documentation and install in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter, for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: No module named ssl_match_hostname"
I finally solved this with a slightly extreme install of the backports.ssl-match-hostname module as described in this SO solution: https://stackoverflow.com/a/51071841/384366
It might be only me that experienced this, but flagging this just in case it's others and you want to put a note in this section.
The text was updated successfully, but these errors were encountered:
I'll have to do a little more testing on this, to make sure it accounts for the case of someone new to Ansible/this example. If you ran into it, chances are someone else will to... one of the things I made sure to do with Ansible for DevOps at one point was take a fresh new machine, and run through the first few chapters to make sure I wasn't missing the install or configuration of something critical.
@qmacro - Thanks again for opening this issue (as I said, if you got this error, chances are someone else did/will too...).
It looks like there are a few possible causes of this problem—and if you look through the main issue relating to this in the docker-py issue queue (docker/docker-py#1502), you'll see there are also a hundred solutions!
It seems like the most important things to try are:
Make sure you're installing docker and not docker-py (pip3 install docker).
Make sure the Ansible playbook is using the same python interpreter where you just installed the docker library, e.g. if you used pip3, see if setting export ANSIBLE_PYTHON_INTERPRETER=$(which python3) gets you a better result.
It seems like 90% of the people reporting issues had problems with their Ansible playbook or other Python projects picking up either a broken installation of the docker library, or just using the wrong Python interpreter altogether (e.g. not using a venv correctly, or using system Python instead of a managed installation...).
This might be too specific an error but it happened to me. In Ch.3 section "docker_image module" we start with the playbook for building the Docker image, using the
docker_image
module.Running the playbook at this point (before moving on to the next section) resulted in an error for me:
I finally solved this with a slightly extreme install of the
backports.ssl-match-hostname
module as described in this SO solution: https://stackoverflow.com/a/51071841/384366It might be only me that experienced this, but flagging this just in case it's others and you want to put a note in this section.
The text was updated successfully, but these errors were encountered: