ansible-collections / community.docker

Community Docker Collection for Ansible: modules and plugins for working with Docker
https://galaxy.ansible.com/ui/repo/published/community/docker/
GNU General Public License v3.0
196 stars 109 forks source link

Support for multiple compose files with docker_compose_v2 module #772

Closed goldyfruit closed 7 months ago

goldyfruit commented 7 months ago
SUMMARY

With docker_compose, we had the capability to use multiple docker-compose.yml files which is very handy when you want to organise pretty large composition.

  community.docker.docker_compose:
    project_src: "{{ _ovos_installer_working_directory }}/{{ _ovos_installer_project_name }}/compose"
    project_name: "{{ _project_name }}"
    files:
      - compose1.yml
      - compose2.yml
      - compose3.yml
    pull: true
    remove_orphans: "{{ ovos_installer_docker_compose_remove_orphans }}"
    remove_images: "{{ ovos_installer_docker_compose_remove_images }}"
    remove_volumes: "{{ ovos_installer_docker_compose_remove_volumes }}"

This capability is missing from docker_compose_v2 but its supported by docker compose CLI.

  -f, --file stringArray           Compose configuration files
ISSUE TYPE
COMPONENT NAME

docker_compose_v2

ADDITIONAL INFORMATION

https://github.com/ansible-collections/community.docker/pull/739#issuecomment-1902704433

felixfontein commented 7 months ago

I created #775 to implement this. Could you please try out whether it works for you? Thanks.

goldyfruit commented 7 months ago

Thanks @felixfontein :+1: