Add docker (pip) package to ansible-playbook
Install pip package in container and modify entrypoint to add given user to docker docker group:
groupadd --gid $(stat --format "%g" /var/run/docker.sock) docker_host
usermod --append --groups docker_host ${ANSIBLE_PLAYBOOK_USER_NAME}
Script should check if /var/run/docker.sock
file exists.