I'm very new at Ansible. I've run following ansible PlayBook and found those errors:
---
- hosts: webservers
remote_user: linx
become: yes
become_method: sudo
tasks:
- name: install docker-py
pip: name=docker-py
- name: Build Docker image from Dockerfile
docker_image:
name: web
path: docker
state: build
- name: Running the container
docker_container:
image: web:latest
path: docker
state: running
- name: Check if container is running
shell: docker ps
Error message:
FAILED! => {"changed": false, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))"}
And here is my folder structure:
.
├── ansible.cfg
├── docker
│ └── Dockerfile
├── hosts
├── main.retry
├── main.yml
I'm confused that docker folder is already inside my local but don't know why I encountered those error message.