EDIT: I'am using the same user and the deamon is running, I can do all my docker command on the target without any issue.
Trying to use reponsse module without success. I think the issue is comming from PATH what's not be loaded so cannot found docker bin.
Tryed with command: /bin/bash "docker image prune --all "
but not working
Have you any idea ?
- name: docker image prune
# become: True
expect:
command: docker image prune --all
responses:
(?i)continue: "y"
ERROR:
TASK [docker_purge : docker image prune] ********************************************
fatal: [s00xxxxxx]: FAILED! => {"changed": true, "cmd": "docker image prune --all", "delta": "0:00:00.187062", "end": "2020-02-12 11:17:38.911435", "msg": "non-zero return code", "rc": 1, "start": "2020-02-12 11:17:38.724373", "stdout": "WARNING! This will remove all images without at least one container associated to them.\r\nAre you sure you want to continue? [y/N] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?", "stdout_lines": ["WARNING! This will remove all images without at least one container associated to them.", "Are you sure you want to continue? [y/N] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"]}
Thanks