as a followup:

stefan@docker1:~$ python
Python 2.7.9 (default, Mar  1 2015, 12:57:24) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from docker import Client
>>> c = Client(base_url='unix://var/run/docker.sock')
>>> c.containers()
[{u'Status': u'Up About a minute', u'Created': 1432548197, u'Image': 
u'webtest:latest', u'Labels': {}, u'Ports': [{u'IP': u'18.18.10.16', 
u'Type': u'tcp', u'PublicPort': 8080, u'PrivatePort': 80}], u'Command': 
u'apache2ctl -DFOREGROUND', u'Names': [u'/webtest'], u'Id': 
u'097yj2dfafb0215e10e8ef7fb506866e72782ea211678e2ba8700215b033011'}]

this works aswell, so the python-py have permission when ran locally. and I 
initate the playbook with

ansible-playbook -i hosts.yml -l webtest  test.yml -u stefan
and facts is gathered without issues

Den måndag 25 maj 2015 kl. 11:29:37 UTC+2 skrev Stefan Eriksson:
>
> 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
>     inet 18.10.10.16/24 brd 10.18.10.255 scope global eth0
>
>
> 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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/35416bc4-54e6-4a5e-9ba3-ae08c44d28b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to