Hi I'm trying out the docker module and I want to run it without sudo as root, but dont know why I get permission errors, running locally works great.
I've added usermod -aG docker stefan
stefan@docker1:~$ groups
stefan docker
stefan@docker1:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
097yj2dfafb02 webtest:latest "apache2ctl -DFOREGR 35 minutes ago Up 35 minutes 18.18.10.16:8080->80/tcp webtest
stefan@docker1:~$ docker stop 4927fdfafb02
097yj2dfafb02
IP
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
And the ansible command:
- name: remove container
docker:
name: "{{ ansible_hostname }}"
image: webtest
state: absent
sudo: no
failed: [18.18.10.16] => {"changed": false, "failed": true}
msg: ConnectionError(ProtocolError('Connection aborted.', error(13, 'Permission denied')),)
I dont know why I get permission denied when I can run the commands locally with docker.