Probably the easiest thing to do is forward a port to ssh in your container when you launch it and then connect to that in Ansible like a standard host. That should be quite easy to do.
A quick google also shows this... https://docs.ansible.com/ansible/latest/plugins/connection/docker.html Not used it but again it looks simple enough. R On Tuesday, May 19, 2020 at 6:15:40 PM UTC+2, Galena Teneva wrote: > > I want to use Hadoop from CDH docker image. CDH image is already installed > on my machine and I can run it. > > > docker ps -a >> >> CONTAINER ID IMAGE COMMAND >> CREATED STATUS PORTS >> NAMES >> 07a55a9d4cb9 4239cd2958c6 "/usr/bin/docker-quickstart" 18 >> minutes ago Up 18 minutes 0.0.0.0:32774->7180/tcp, >> 0.0.0.0:32773->8888/tcp container >> >> >> docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' >> container >> >> 172.17.0.2 >> >> > Local, I am writing an ansible playbook and I need to set Hadoop conf dir > in CDH which is: "/etc/hadoop/conf". How can I set the running docker image > in my ansible playbook? > > I tried: > > - name: run cloudera >> docker_container: >> name: "container" >> image: quickstart/cloudera >> command: /usr/bin/docker-quickstart" >> state: started >> ports: >> - 8888:8888 >> - 7180:7180 >> >> > But this command runs another docker image and I would like to connect to > the running one. > -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/77d5f805-8774-4d8d-b615-25e7a28a81fc%40googlegroups.com.