community.docker icon indicating copy to clipboard operation
community.docker copied to clipboard

Compose profiles not respected when defined via .env variable

Open hnicke opened this issue 9 months ago • 3 comments

SUMMARY

The docker_compose module does not respect compose profiles which are specified via env variable COMPOSE_PROFILES using the .env file.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

docker_compose

ANSIBLE VERSION
ansible [core 2.15.3]
  config file = None
  configured module search path = ['/home/heiko/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/heiko/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.3 (main, Jun  5 2023, 09:32:32) [GCC 13.1.1 20230429] (/usr/bin/python)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
community.docker 3.4.8

OS / ENVIRONMENT

arch linux

STEPS TO REPRODUCE

Use the following .env file:

# .env file
COMPOSE_PROFILES=foo
EXPECTED RESULTS

The profile foo is activated. I.e., the very same behavior as when running docker-compose up directly.

ACTUAL RESULTS

The profile foo is not activated. Thus, it runs with profiles=[].

hnicke avatar Sep 10 '23 16:09 hnicke