РЕДАКТИРОВАТЬ: Я использую того же пользователя, и демон работает, я могу выполнить все мои команды docker на цели без каких-либо проблем.
Попытка использовать модуль ответа без успеха. Я думаю, что проблема приходит из PATH, что не загружается, поэтому не может найти docker bin. Пробовал с command: /bin/bash "docker image prune --all "
, но не работает. Есть идеи?
- name: docker image prune
# become: True
expect:
command: docker image prune --all
responses:
(?i)continue: "y"
ОШИБКА:
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?"]}
Спасибо