Hi /BK,
If you want to manage volumes in Docker containers, you can use the same Docker CLI-style syntax: [host_directory]:[container_directory] into the volumes parameters (for multiple mounts, use list syntax).
I have an example with the official PostgreSQL Docker image:
- name: Run PostgreSQL Docker image
docker:
name: postgresql
image: postgres
ports: 5432:5432
volumes:
- /opt/postgresql/data:/var/lib/postgresql/data
state: running
For your example, volumes should end up with something like that:
[…]
volumes:
- /opt/my_logs1:/opt/my_logs1
- /opt/my_logs2:/opt/my_logs2
[…]
I hope that my answer will be helpfull.
Regards,
Guillaume