i have the same error
`
bash-4.4# ansible-playbook 04-loadbalancer.yml
PLAY [master] **********************************************************************************************************************************************************************************************
TASK [Gathering Facts] *************************************************************************************************************************************************************************************
ok: [master01]
TASK [loadbalancer : make lb dir] **************************************************************************************************************************************************************************
ok: [master01]
TASK [loadbalancer : generate lb config] *******************************************************************************************************************************************************************
ok: [master01]
TASK [loadbalancer : copy lb images] ***********************************************************************************************************************************************************************
changed: [master01]
TASK [loadbalancer : load lb image] ************************************************************************************************************************************************************************
fatal: [master01]: 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 localhost.localdomain’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 requests.exceptions”}
PLAY RECAP *************************************************************************************************************************************************************************************************
master01 : ok=4 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
`
master01 is centos 7.7
i install docker 18.09.9 with binary at master01
ansible server version:
`
bash-4.4# ansible --version
ansible 2.9.2
config file = None
configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.9 (default, Oct 17 2019, 11:10:22) [GCC 8.3.0]
`
i change my task to shell it is ok.but docker_image and docker-container will error
`
- name: load lb image
shell: ‘docker load -i {{ dpath }}/loadbalancer/haproxy-{{ haproxy_version }}.tar.bz2’
docker_image:
load_path: ‘{{ dpath }}/loadbalancer/haproxy-{{ haproxy_version }}.tar.bz2’
name: lb
timeout: 600
`