Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env_file directive in docker_container tasks has no effect since 3.0.0 #451

Closed
OrfeasZ opened this issue Aug 13, 2022 · 1 comment · Fixed by #452
Closed

env_file directive in docker_container tasks has no effect since 3.0.0 #451

OrfeasZ opened this issue Aug 13, 2022 · 1 comment · Fixed by #452
Labels
bug Something isn't working docker-plain plain Docker (no swarm, no compose, no stack)

Comments

@OrfeasZ
Copy link

OrfeasZ commented Aug 13, 2022

SUMMARY

env_file directive in docker_container tasks has no effect.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

docker_container

ANSIBLE VERSION
ansible [core 2.12.5.post0]
  config file = None
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.13 (default, Jun 24 2022, 15:27:57) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)]
  jinja version = 2.11.3
  libyaml = True
COLLECTION VERSION
3.0.0
CONFIGURATION
Unable to get at this time since we are running through AWX.
OS / ENVIRONMENT

Target machines are running Ubuntu 20.04 with Docker 20.10.11.

STEPS TO REPRODUCE
docker_container:
    name: my-container
    state: started
    image: my-image:latest
    env_file: /my-env-file.env
EXPECTED RESULTS

The created docker container should inherit the environment variables from the file specified in the env_file key.

ACTUAL RESULTS

The created docker container doesn't have any environment variables set.

This issue seems to have been introduced in yesterday's 3.0.0 release, causing deployments across our entire cluster to fail. Downgrading to 2.7.0 resolved this issue.

@felixfontein
Copy link
Collaborator

Thanks for reporting this!

Looks like the env_file tests were totally inadequate of testing whether the option actually works... #452 improves the env and env_file tests and fixes this issue.

@felixfontein felixfontein added bug Something isn't working docker-plain plain Docker (no swarm, no compose, no stack) labels Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker-plain plain Docker (no swarm, no compose, no stack)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants