Hi,

I think you're looking after this documentation: 
http://docs.ansible.com/ansible/intro_inventory.html#non-ssh-connection-types

You can use ansible_docker_extra_args and provide the docker host 
associated with your containers (with something like 
-H=docker-engine1:port).

Then, you can use fetch to retrieve your logs localy in a playbook.

Hope it helps :)

Yannig

Le mercredi 28 septembre 2016 18:59:55 UTC+2, Ionut Cadariu a écrit :
>
> Hello,
>
> I have docker containers running on multiple hosts and I need to find a 
> way of synchronizing  a list of logs from each of these containers to the 
> ansible server but I can't find a way to do it.
>
> Can someone point me to documentation, give me a hint how I should 
> approach this or to an ansible module (I have found some modules to create 
> containers but not to run commands on them or to extract container ids) ?
>
>
> Until now I've tried using ansible ad-hoc commands but I'm not being able 
> to create a correct playbook to do this for me. 
> What I was thinking is to store container ID (obtained using some bash 
> commands) into a variable and with that variable to run docker cp 
> $containerID:/var/log/test .
>
>
> Thanks,
> Ionut
>

-- 
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/74aa7c99-529c-4025-9556-cab7828ffc5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to